This is a routine to test DGELS which solves solves full rank overdetermined ( linear least squares ) or underdetermined (minimum norm) linear systems.
The check is, as follows,
(1) If the system is consistent, (smallresidual,) we check that
|| A^T ( b – A * x ) || / (||A||*||b||*max(M,N,NRHS)*eps)
is small (say less than 30).
(2) If the system is not consistent, (large residual,) we check that
|| A^T ( b – A * x ) || / (||A||*|| b - A*x ||*max(M,N,NRHS)*eps)
is small (say less than 30).
DQRT17 was checking in the not consistent case (large residual) that
|| A^T ( b – A * x ) || / (||A||*||x||*max(M,N,NRHS)*eps)
is small. It is a mistake and we need to change the ||x|| by a ||r||.
This fix is consistent with what the documentation says and makes more sense.
IF( NORMB.NE.ZERO )
$ ERR = ERR / NORMB
ELSE
- NORMX = CLANGE( 'One-norm', NCOLS, NRHS, X, LDX, RWORK )
- IF( NORMX.NE.ZERO )
- $ ERR = ERR / NORMX
+ IF( NORMRS.NE.ZERO )
+ $ ERR = ERR / NORMRS
END IF
*
CQRT17 = ERR / ( SLAMCH( 'Epsilon' )*REAL( MAX( M, N, NRHS ) ) )
IF( NORMB.NE.ZERO )
$ ERR = ERR / NORMB
ELSE
- NORMX = DLANGE( 'One-norm', NCOLS, NRHS, X, LDX, RWORK )
- IF( NORMX.NE.ZERO )
- $ ERR = ERR / NORMX
+ IF( NORMRS.NE.ZERO )
+ $ ERR = ERR / NORMRS
END IF
*
DQRT17 = ERR / ( DLAMCH( 'Epsilon' )*DBLE( MAX( M, N, NRHS ) ) )
IF( NORMB.NE.ZERO )
$ ERR = ERR / NORMB
ELSE
- NORMX = SLANGE( 'One-norm', NCOLS, NRHS, X, LDX, RWORK )
- IF( NORMX.NE.ZERO )
- $ ERR = ERR / NORMX
+ IF( NORMRS.NE.ZERO )
+ $ ERR = ERR / NORMRS
END IF
*
SQRT17 = ERR / ( SLAMCH( 'Epsilon' )*REAL( MAX( M, N, NRHS ) ) )
IF( NORMB.NE.ZERO )
$ ERR = ERR / NORMB
ELSE
- NORMX = ZLANGE( 'One-norm', NCOLS, NRHS, X, LDX, RWORK )
- IF( NORMX.NE.ZERO )
- $ ERR = ERR / NORMX
+ IF( NORMRS.NE.ZERO )
+ $ ERR = ERR / NORMRS
END IF
*
ZQRT17 = ERR / ( DLAMCH( 'Epsilon' )*DBLE( MAX( M, N, NRHS ) ) )