Description
Description
From the docs:
DGECON estimates the reciprocal of the condition number of a general
real matrix A, in either the 1-norm or the infinity-norm, using
the LU factorization computed by DGETRF.
An estimate is obtained for norm(inv(A)), and the reciprocal of the
condition number is computed as
RCOND = 1 / ( norm(A) * norm(inv(A)) ).
DGECON seems to compute fairly bad estimates of the reciprocal 1-norm condition numbers when applied to the LU factorization of the 2x2 matrix
A(p) = [ 1.0 p ]
[ 0.0 1.0 ]
with 0<p<1
, and good estimates outside that range.
Note that the inverse of A(p)
is A(-p)
, and both have a 1-norm of 1+abs(p)
, so the reciprocal of the 1-norm condition number is 1/(1+abs(p))^2
.
Minimal example: dgecon_example.c.txt
Use plot_cond.py.txt for reproducing the above plot.
Note that the LU decomposition with dgetrf
works well for all -3<p<3
, plotted with
plot_lu.py.txt:
Also the anorm
computed with dlange
is fine for all -3<p<3
.
Checklist
- I've included a minimal example to reproduce the issue
- I'd be willing to make a PR to solve this issue
I'd be willing to investigate the accuracy problem further if it is not yet understood and if a better accuracy appears desirable (given that dgecon
only computes an estimate without specified tolerances).