Skip to content

Conversation

@soypat
Copy link
Contributor

@soypat soypat commented Jun 5, 2021

So the checklist is NOT complete. I intend for this to be a first review of how LAPACK routines are implemented in Go and get some feedback. I'm sure my indexing is messed up, was quite confused seeeing how fortran alternated betweeen double and single indexing. #1651 related.

No tests implemented.

Copy link
Member

@kortschak kortschak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now. Thanks. Some minor nits and tests (take a look at how @vladimir-ch implements tests in the testlapack package) — here you would take random inputs with a variety of dimensions and strides, do the LU with Dgetc2 (needs to be implemented - looks very straightforward) and pass in the LU part, checking on return that the equation in the docs is satisfied.

@vladimir-ch vladimir-ch changed the title add dgesdc2 and unimplemented dependencies lapack/gonum: add Dgesc2 Jun 6, 2021
Copy link
Member

@vladimir-ch vladimir-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a test before merging for which Dgetc2 must be implemented (with a test).

@soypat
Copy link
Contributor Author

soypat commented Jun 6, 2021

Some lessons learned:

  • Parenthesis matter. They can prevent precision loss and overflow if done correctly.
  • lda is the "leading dimension" and used to index matrices, not n/m (actual dimensions)
  • Documentation must be taken care of properly
  • Add bounds/length checks not present in reference

As for the test, I need to generate not only the general matrix but also ipiv and jpiv. I'll take a look at other tests which do this i.e. dlaqp2.go and dlaqps.go

@vladimir-ch
Copy link
Member

As for the test, I need to generate not only the general matrix but also ipiv and jpiv.

It will be much easier (and more correct) if you first implement Dgetc2 and use it in the test to generate input for Dgesc2.

@soypat
Copy link
Contributor Author

soypat commented Jun 6, 2021

It will be much easier (and more correct) if you first implement Dgetc2 and use it in the test to generate input for Dgesc2.

should I do it in this PR? should I start another?

@vladimir-ch
Copy link
Member

Dgetc2 should be a separate PR.

@soypat soypat mentioned this pull request Jun 9, 2021
@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2021

Codecov Report

Merging #1652 (dc7652f) into master (0164be0) will increase coverage by 0.01%.
The diff coverage is 39.39%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1652      +/-   ##
==========================================
+ Coverage   73.24%   73.25%   +0.01%     
==========================================
  Files         506      507       +1     
  Lines       59955    60006      +51     
==========================================
+ Hits        43913    43958      +45     
- Misses      13556    13562       +6     
  Partials     2486     2486              
Impacted Files Coverage Δ
lapack/gonum/dgesc2.go 39.39% <39.39%> (ø)
optimize/listsearch.go 72.22% <0.00%> (-1.86%) ⬇️
interp/cubic.go 98.16% <0.00%> (+0.66%) ⬆️
lapack/gonum/dlasy2.go 96.00% <0.00%> (+8.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0164be0...dc7652f. Read the comment docs.

@soypat
Copy link
Contributor Author

soypat commented Jun 12, 2021

Dgesc2 is passing albeit without the test you mentioned. I tried programming it and ended up leaving the t.Error declaration commented because it was failing although X was being calculated correctly.

@soypat soypat requested a review from vladimir-ch June 12, 2021 04:02
@soypat soypat mentioned this pull request Jun 13, 2021
@soypat
Copy link
Contributor Author

soypat commented Jun 14, 2021

pinging. Needed for #1658 and #1669.

worth mentioning #1665 is ready for merge too.

Copy link
Member

@vladimir-ch vladimir-ch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after the two comments. I'll fix the test later.

@soypat
Copy link
Contributor Author

soypat commented Jun 16, 2021

@vladimir-ch Thanks for taking a look!

@vladimir-ch vladimir-ch merged commit c0f40d7 into gonum:master Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants