Skip to content
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

Dtrcon vs. Dgecon infinity norm mismatch #636

Closed
btracey opened this issue Sep 9, 2015 · 5 comments

Comments

@btracey
Copy link
Contributor

commented Sep 9, 2015

Dtrcon sometimes gives different results than Dgecon for the condition number of a matrix.

Take the matrix
a = [2 0 0
5 6 0
8 9 10]

The infinity norm of this matrix is 27 (8 + 9 + 10)
Its inverse is
aI = [1/2 0 0
-5 / 12 1/6 0
-1 / 40 -3/20 1/10]
The infinity norm of this matrix is 7 / 12. (5/12 + 1/6)
Thus, the inverse condition number is 1 / (27 * 7 / 12) = 4/63 = 0.6349

Running Dgecon on the LU factorization of this matrix I indeed get this answer. Running Dtrcon I get 0.074074. Based on my reading of the Dtrcon description, these two answers should be the same. I don't think it's a problem with OpenBLAS specifically, as I get the same 0.074074 with my Go implementation of the Dtrcon algorithm. Happy to file a Lapack bug if you agree this is an issue.

@martin-frbg

This comment has been minimized.

Copy link
Collaborator

commented Feb 25, 2017

Just curious, did you ever follow this up with the netlib folks ?

@vladimir-ch

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

Also this is due to the pivoting done in DGETRF (for DGECON). If I remove the pivoting in DGETF2 (this matrix is too small for the blocked algorithm), then DGECON returns the same (slightly inexact) condition number. It seems that a bare triangular solve (DTRSV in this case) is not accurate enough and the difference is enough for DLACN2 to converge to an inexact estimate.

@vladimir-ch

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

Oh, wait, there is something strange on our side after all. I'll let you know.

@vladimir-ch

This comment has been minimized.

Copy link
Contributor

commented Aug 16, 2019

Ok, we had a bug in Dlantr which affected only 1x1 matrices. My previous comment still stands and my additional testing makes me feel more confident that it's correct. If you want you can close this.

@martin-frbg

This comment has been minimized.

Copy link
Collaborator

commented Aug 16, 2019

Thank you very much for your valuable insight as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.