New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lapack/gonum: fix various bugs in Dgetri #806
Conversation
The block size adjustment is not covered by Dgetri's test, so should be added too (later). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
@@ -49,7 +49,7 @@ func (impl Implementation) Dgetri(n int, a []float64, lda int, ipiv []int, work | |||
if nb > 1 && nb < n { | |||
iws := max(ldwork*n, 1) | |||
if lwork < iws { | |||
nb = lwork / ldwork | |||
nb = lwork / n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like a row vs col major issue, so does this affect the NETLIB implementation as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a row vs column major issue. This line calculates "how many columns fit into the workspace we have". For reference the column size is ldwork, for us it's n.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes, the assignment to ldwork
above. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep ... sorry.
} | ||
bi.Dtrsm(blas.Right, blas.Lower, blas.NoTrans, blas.Unit, n, jb, 1, work[j*ldwork:], ldwork, a[j:], lda) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nasty non-bracketed conditional blocks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, the code there is particularly difficult to parse. I had to stare on it for a while and still wasn't completely sure if dtrsm is under the if or not.
PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
If you want to rebase that commit back in to your PR structure go ahead and ping me when you're done and I'll reapprove. Otherwise go ahead now.
It's ok, I'll merge as it is. |
Fixes #805
Please take a look.