{{ message }}

# Dtrcon vs. Dgecon infinity norm mismatch#636

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

# Dtrcon vs. Dgecon infinity norm mismatch#636

opened this issue Sep 9, 2015 · 5 comments

### btracey 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. The text was updated successfully, but these errors were encountered:

### martin-frbg commented Feb 25, 2017

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

### vladimir-ch 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 commented Aug 16, 2019

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

### vladimir-ch 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 commented Aug 16, 2019

 Thank you very much for your valuable insight as usual.