Author: deaglanhalligan Date: Tue Apr 7 20:05:18 2009 New Revision: 650 URL: https://icl.cs.utk.edu/trac/lapack-dev/changeset/650 Log: Updated documentation for EPIR routines. Changed ERRS_{N,C} variable names. Other cosmetic changes. Modified: lapack/trunk/SRC/cgbrfsx.f lapack/trunk/SRC/cgerfsx.f lapack/trunk/SRC/cherfsx.f lapack/trunk/SRC/chesvxx.f lapack/trunk/SRC/cla_gbrcond_c.f lapack/trunk/SRC/cla_gbrcond_x.f lapack/trunk/SRC/cla_gbrfsx_extended.f lapack/trunk/SRC/cla_gbrpvgrw.f lapack/trunk/SRC/cla_gercond_c.f lapack/trunk/SRC/cla_gercond_x.f lapack/trunk/SRC/cla_gerfsx_extended.f lapack/trunk/SRC/cla_hercond_c.f lapack/trunk/SRC/cla_hercond_x.f lapack/trunk/SRC/cla_herfsx_extended.f lapack/trunk/SRC/cla_herpvgrw.f lapack/trunk/SRC/cla_lin_berr.f lapack/trunk/SRC/cla_porcond_c.f lapack/trunk/SRC/cla_porcond_x.f lapack/trunk/SRC/cla_porfsx_extended.f lapack/trunk/SRC/cla_porpvgrw.f lapack/trunk/SRC/cla_rpvgrw.f lapack/trunk/SRC/cla_syrcond_c.f lapack/trunk/SRC/cla_syrcond_x.f lapack/trunk/SRC/cla_syrfsx_extended.f lapack/trunk/SRC/cla_syrpvgrw.f lapack/trunk/SRC/clarscl2.f lapack/trunk/SRC/clascl2.f lapack/trunk/SRC/cporfsx.f lapack/trunk/SRC/csyrfsx.f lapack/trunk/SRC/csysvxx.f lapack/trunk/SRC/dgbrfsx.f lapack/trunk/SRC/dgerfsx.f lapack/trunk/SRC/dla_gbrcond.f lapack/trunk/SRC/dla_gbrfsx_extended.f lapack/trunk/SRC/dla_gbrpvgrw.f lapack/trunk/SRC/dla_gercond.f lapack/trunk/SRC/dla_gerfsx_extended.f lapack/trunk/SRC/dla_lin_berr.f lapack/trunk/SRC/dla_porcond.f lapack/trunk/SRC/dla_porfsx_extended.f lapack/trunk/SRC/dla_porpvgrw.f lapack/trunk/SRC/dla_rpvgrw.f lapack/trunk/SRC/dla_syrcond.f lapack/trunk/SRC/dla_syrfsx_extended.f lapack/trunk/SRC/dla_syrpvgrw.f lapack/trunk/SRC/dlarscl2.f lapack/trunk/SRC/dlascl2.f lapack/trunk/SRC/dporfsx.f lapack/trunk/SRC/dsyrfsx.f lapack/trunk/SRC/dsysvxx.f lapack/trunk/SRC/sgbrfsx.f lapack/trunk/SRC/sgerfsx.f lapack/trunk/SRC/sla_gbrcond.f lapack/trunk/SRC/sla_gbrfsx_extended.f lapack/trunk/SRC/sla_gbrpvgrw.f lapack/trunk/SRC/sla_gercond.f lapack/trunk/SRC/sla_gerfsx_extended.f lapack/trunk/SRC/sla_lin_berr.f lapack/trunk/SRC/sla_porcond.f lapack/trunk/SRC/sla_porfsx_extended.f lapack/trunk/SRC/sla_porpvgrw.f lapack/trunk/SRC/sla_rpvgrw.f lapack/trunk/SRC/sla_syrcond.f lapack/trunk/SRC/sla_syrfsx_extended.f lapack/trunk/SRC/sla_syrpvgrw.f lapack/trunk/SRC/slarscl2.f lapack/trunk/SRC/slascl2.f lapack/trunk/SRC/sporfsx.f lapack/trunk/SRC/ssyrfsx.f lapack/trunk/SRC/ssysvxx.f lapack/trunk/SRC/zgbrfsx.f lapack/trunk/SRC/zgerfsx.f lapack/trunk/SRC/zherfsx.f lapack/trunk/SRC/zhesvxx.f lapack/trunk/SRC/zla_gbrcond_c.f lapack/trunk/SRC/zla_gbrcond_x.f lapack/trunk/SRC/zla_gbrfsx_extended.f lapack/trunk/SRC/zla_gbrpvgrw.f lapack/trunk/SRC/zla_gercond_c.f lapack/trunk/SRC/zla_gercond_x.f lapack/trunk/SRC/zla_gerfsx_extended.f lapack/trunk/SRC/zla_hercond_c.f lapack/trunk/SRC/zla_hercond_x.f lapack/trunk/SRC/zla_herfsx_extended.f lapack/trunk/SRC/zla_herpvgrw.f lapack/trunk/SRC/zla_lin_berr.f lapack/trunk/SRC/zla_porcond_c.f lapack/trunk/SRC/zla_porcond_x.f lapack/trunk/SRC/zla_porfsx_extended.f lapack/trunk/SRC/zla_porpvgrw.f lapack/trunk/SRC/zla_rpvgrw.f lapack/trunk/SRC/zla_syrcond_c.f lapack/trunk/SRC/zla_syrcond_x.f lapack/trunk/SRC/zla_syrfsx_extended.f lapack/trunk/SRC/zla_syrpvgrw.f lapack/trunk/SRC/zlarscl2.f lapack/trunk/SRC/zlascl2.f lapack/trunk/SRC/zporfsx.f lapack/trunk/SRC/zsyrfsx.f lapack/trunk/SRC/zsysvxx.f Modified: lapack/trunk/SRC/cgbrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cgbrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cgbrfsx.f (original) +++ lapack/trunk/SRC/cgbrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,8 +36,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/cgerfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cgerfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cgerfsx.f (original) +++ lapack/trunk/SRC/cgerfsx.f Tue Apr 7 20:05:18 2009 @@ -35,8 +35,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/cherfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cherfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cherfsx.f (original) +++ lapack/trunk/SRC/cherfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine CHERFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, + SUBROUTINE CHERFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, $ S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -35,7 +35,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/chesvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/chesvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/chesvxx.f (original) +++ lapack/trunk/SRC/chesvxx.f Tue Apr 7 20:05:18 2009 @@ -155,7 +155,7 @@ * IPIV (input or output) INTEGER array, dimension (N) * If FACT = 'F', then IPIV is an input argument and on entry * contains details of the interchanges and the block -* structure of D, as determined by SSYTRF. If IPIV(k) > 0, +* structure of D, as determined by CHETRF. If IPIV(k) > 0, * then rows and columns k and IPIV(k) were interchanged and * D(k,k) is a 1-by-1 diagonal block. If UPLO = 'U' and * IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and @@ -166,7 +166,7 @@ * * If FACT = 'N', then IPIV is an output argument and on exit * contains details of the interchanges and the block -* structure of D, as determined by SSYTRF. +* structure of D, as determined by CHETRF. * * EQUED (input or output) CHARACTER*1 * Specifies the form of equilibration that was done. Modified: lapack/trunk/SRC/cla_gbrcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gbrcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gbrcond_c.f (original) +++ lapack/trunk/SRC/cla_gbrcond_c.f Tue Apr 7 20:05:18 2009 @@ -32,11 +32,61 @@ * Arguments * ========= * -* C REAL vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) COMPLEX array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by CGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX workspace of size 2*N. +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. * -* RWORK REAL workspace of size N. +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * @@ -72,16 +122,17 @@ NOTRANS = LSAME( TRANS, 'N' ) IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT. $ LSAME( TRANS, 'C' ) ) THEN + INFO = -1 ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'CLA_GBRCOND_C', -INFO ) Modified: lapack/trunk/SRC/cla_gbrcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gbrcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gbrcond_x.f (original) +++ lapack/trunk/SRC/cla_gbrcond_x.f Tue Apr 7 20:05:18 2009 @@ -31,11 +31,58 @@ * Arguments * ========= * -* X COMPLEX vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) COMPLEX array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by CGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* X (input) COMPLEX array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX workspace of size 2*N. +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. * -* RWORK REAL workspace of size N. +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * @@ -76,13 +123,13 @@ ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'CLA_GBRCOND_X', -INFO ) Modified: lapack/trunk/SRC/cla_gbrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gbrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gbrfsx_extended.f (original) +++ lapack/trunk/SRC/cla_gbrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,10 +1,10 @@ SUBROUTINE CLA_GBRFSX_EXTENDED ( PREC_TYPE, TRANS_TYPE, N, KL, KU, $ NRHS, AB, LDAB, AFB, LDAFB, IPIV, $ COLEQU, C, B, LDB, Y, LDY, - $ BERR_OUT, N_NORMS, ERRS_N, ERRS_C, - $ RES, AYB, DY, Y_TAIL, RCOND, - $ ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ BERR_OUT, N_NORMS, ERR_BNDS_NORM, + $ ERR_BNDS_COMP, RES, AYB, DY, + $ Y_TAIL, RCOND, ITHRESH, RTHRESH, + $ DZ_UB, IGNORE_CWISE, INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +27,263 @@ COMPLEX AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB(*), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* CLA_GBRFSX_EXTENDED computes ... . +* CLA_GBRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by CGBRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0 +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* AB (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDAB (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AFB (input) COMPLEX array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by CGBTRF. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by CGBTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by CLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to CGBTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -282,10 +528,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/cla_gbrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gbrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gbrpvgrw.f (original) +++ lapack/trunk/SRC/cla_gbrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -20,12 +20,49 @@ * * Purpose * ======= -* -* CLA_GBRPVGRW computes ... . +* +* CLA_GBRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* AB (input) COMPLEX array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by CGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* * ===================================================================== * * .. Local Scalars .. @@ -45,7 +82,7 @@ * .. Executable Statements .. * RPVGRW = 1.0 -* + KD = KU + 1 DO J = 1, NCOLS AMAX = 0.0 Modified: lapack/trunk/SRC/cla_gercond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gercond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gercond_c.f (original) +++ lapack/trunk/SRC/cla_gercond_c.f Tue Apr 7 20:05:18 2009 @@ -31,11 +31,49 @@ * Arguments * ========= * -* C REAL vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by CGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_gercond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gercond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gercond_x.f (original) +++ lapack/trunk/SRC/cla_gercond_x.f Tue Apr 7 20:05:18 2009 @@ -30,11 +30,46 @@ * Arguments * ========= * -* X COMPLEX vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by CGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* X (input) COMPLEX array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX workspace of size 2*N. +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. * -* RWORK REAL workspace of size N. +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_gerfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_gerfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_gerfsx_extended.f (original) +++ lapack/trunk/SRC/cla_gerfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -33,11 +33,248 @@ * Purpose * ======= * -* CLA_GERFSX_EXTENDED computes ... . +* CLA_GERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by CGERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by CGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by CGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by CGETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by CLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to CGETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/cla_hercond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_hercond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_hercond_c.f (original) +++ lapack/trunk/SRC/cla_hercond_c.f Tue Apr 7 20:05:18 2009 @@ -31,11 +31,46 @@ * Arguments * ========= * -* C REAL vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_hercond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_hercond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_hercond_x.f (original) +++ lapack/trunk/SRC/cla_hercond_x.f Tue Apr 7 20:05:18 2009 @@ -30,11 +30,43 @@ * Arguments * ========= * -* X COMPLEX vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* X (input) COMPLEX array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_herfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_herfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_herfsx_extended.f (original) +++ lapack/trunk/SRC/cla_herfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE CLA_HERFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,254 @@ COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* CLA_HERFSX_EXTENDED computes ... . +* +* CLA_HERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by CHERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by CHETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by CLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to CHETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -279,10 +517,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/cla_herpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_herpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_herpvgrw.f (original) +++ lapack/trunk/SRC/cla_herpvgrw.f Tue Apr 7 20:05:18 2009 @@ -24,11 +24,50 @@ * Purpose * ======= * -* CLA_HERPVGRW computes ... . +* CLA_HERPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from SSYTRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* WORK (input) COMPLEX array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/cla_lin_berr.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_lin_berr.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_lin_berr.f (original) +++ lapack/trunk/SRC/cla_lin_berr.f Tue Apr 7 20:05:18 2009 @@ -21,12 +21,36 @@ * Purpose * ======= * -* CLA_LIN_BERR computes component-wise relative backward error from +* CLA_LIN_BERR computes componentwise relative backward error from * the formula * max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) -* where abs(Z) is the component-wise absolute value of the matrix +* where abs(Z) is the componentwise absolute value of the matrix * or vector Z. * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NZ (input) INTEGER +* We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to +* guard against spuriously zero residuals. Default value is N. +* +* NRHS (input) INTEGER +* The number of right hand sides, i.e., the number of columns +* of the matrices AYB, RES, and BERR. NRHS >= 0. +* +* RES (input) DOUBLE PRECISION array, dimension (N,NRHS) +* The residual matrix, i.e., the matrix R in the relative backward +* error formula above. +* +* AYB (input) DOUBLE PRECISION array, dimension (N, NRHS) +* The denominator in the relative backward error formula above, i.e., +* the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B +* are from iterative refinement (see cla_gerfsx_extended.f). +* +* RES (output) COMPLEX array, dimension (NRHS) +* The componentwise relative backward error from the formula above. +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/cla_porcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_porcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_porcond_c.f (original) +++ lapack/trunk/SRC/cla_porcond_c.f Tue Apr 7 20:05:18 2009 @@ -30,11 +30,42 @@ * Arguments * ========= * -* C REAL vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by CPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_porcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_porcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_porcond_x.f (original) +++ lapack/trunk/SRC/cla_porcond_x.f Tue Apr 7 20:05:18 2009 @@ -29,11 +29,39 @@ * Arguments * ========= * -* X COMPLEX vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by CPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* X (input) COMPLEX array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_porfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_porfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_porfsx_extended.f (original) +++ lapack/trunk/SRC/cla_porfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE CLA_PORFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, COLEQU, C, B, LDB, Y, - $ LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -26,17 +27,250 @@ COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* CLA_PORFSX_EXTENDED computes ... . +* +* CLA_PORFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by CPORFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by CPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by CPOTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by CLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to CPOTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -278,10 +512,12 @@ * Compute error bounds. * IF (N_NORMS .GE. 1) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/cla_porpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_porpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_porpvgrw.f (original) +++ lapack/trunk/SRC/cla_porpvgrw.f Tue Apr 7 20:05:18 2009 @@ -22,11 +22,38 @@ * Purpose * ======= * -* CLA_PORPVGRW computes ... . +* CLA_PORPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by CPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* WORK (input) COMPLEX array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/cla_rpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_rpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_rpvgrw.f (original) +++ lapack/trunk/SRC/cla_rpvgrw.f Tue Apr 7 20:05:18 2009 @@ -20,11 +20,36 @@ * Purpose * ======= * -* CLA_RPVGRW computes ... . +* CLA_RPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by CGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* * ===================================================================== * * .. Local Scalars .. @@ -44,7 +69,7 @@ * .. Executable Statements .. * RPVGRW = 1.0 -* + DO J = 1, NCOLS AMAX = 0.0 UMAX = 0.0 Modified: lapack/trunk/SRC/cla_syrcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_syrcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_syrcond_c.f (original) +++ lapack/trunk/SRC/cla_syrcond_c.f Tue Apr 7 20:05:18 2009 @@ -31,11 +31,46 @@ * Arguments * ========= * -* C REAL vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CSYTRF. +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_syrcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_syrcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_syrcond_x.f (original) +++ lapack/trunk/SRC/cla_syrcond_x.f Tue Apr 7 20:05:18 2009 @@ -30,11 +30,43 @@ * Arguments * ========= * -* X COMPLEX vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK REAL workspace of size N. +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CSYTRF. +* +* X (input) COMPLEX array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX array, dimension (2*N). +* Workspace. +* +* RWORK (input) REAL array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/cla_syrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_syrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_syrfsx_extended.f (original) +++ lapack/trunk/SRC/cla_syrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE CLA_SYRFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,254 @@ COMPLEX A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* CLA_SYRFSX_EXTENDED computes ... . +* +* CLA_SYRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by CSYRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CSYTRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by CSYTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by CLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to CSYTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -279,10 +517,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/cla_syrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cla_syrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cla_syrpvgrw.f (original) +++ lapack/trunk/SRC/cla_syrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -24,11 +24,50 @@ * Purpose * ======= * -* CLA_SYRPVGRW computes ... . +* CLA_SYRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from CSYTRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by CSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CSYTRF. +* +* WORK (input) COMPLEX array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/clarscl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/clarscl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/clarscl2.f (original) +++ lapack/trunk/SRC/clarscl2.f Tue Apr 7 20:05:18 2009 @@ -23,21 +23,32 @@ * * CLARSCL2 performs a reciprocal diagonal scaling on an vector: * x <-- inv(D) * x -* where the diagonal matrix D is stored as a vector. -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* where the REAL diagonal matrix D is stored as a vector. +* +* Eventually to be replaced by BLAS_cge_diag_scale in the new BLAS * standard. * * Arguments * ========= -* N (input) INTEGER -* The size of the vectors X and D. * -* D (input) REAL array, length N -* Diagonal matrix D, stored as a vector of length N. -* X (input/output) COMPLEX array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. +* +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) REAL array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) COMPLEX array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== +* * .. Local Scalars .. INTEGER I, J * .. @@ -45,10 +56,10 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) / D(I) + X( I, J ) = X( I, J ) / D( I ) END DO END DO -* + RETURN END -* + Modified: lapack/trunk/SRC/clascl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/clascl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/clascl2.f (original) +++ lapack/trunk/SRC/clascl2.f Tue Apr 7 20:05:18 2009 @@ -23,21 +23,32 @@ * * CLASCL2 performs a diagonal scaling on a vector: * x <-- D * x -* where the diagonal matrix D is stored as a vector. -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* where the diagonal REAL matrix D is stored as a vector. +* +* Eventually to be replaced by BLAS_cge_diag_scale in the new BLAS * standard. * * Arguments * ========= -* N (input) INTEGER -* The size of the vectors X and D. * -* D (input) REAL array, length N -* Diagonal matrix D, stored as a vector of length N. -* X (input/output) COMPLEX array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. +* +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) REAL array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) COMPLEX array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== +* * .. Local Scalars .. INTEGER I, J * .. @@ -45,10 +56,10 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) * D(I) + X( I, J ) = X( I, J ) * D( I ) END DO END DO -* + RETURN END -* + Modified: lapack/trunk/SRC/cporfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/cporfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/cporfsx.f (original) +++ lapack/trunk/SRC/cporfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine CPORFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B, + SUBROUTINE CPORFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B, $ LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -35,7 +35,8 @@ * definite, and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS for details of the error bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/csyrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/csyrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/csyrfsx.f (original) +++ lapack/trunk/SRC/csyrfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine CSYRFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, + SUBROUTINE CSYRFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, $ S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -36,7 +36,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/csysvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/csysvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/csysvxx.f (original) +++ lapack/trunk/SRC/csysvxx.f Tue Apr 7 20:05:18 2009 @@ -115,6 +115,10 @@ * = 'E': The matrix A will be equilibrated if necessary, then * copied to AF and factored. * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0. Modified: lapack/trunk/SRC/dgbrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dgbrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dgbrfsx.f (original) +++ lapack/trunk/SRC/dgbrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,8 +36,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/dgerfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dgerfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dgerfsx.f (original) +++ lapack/trunk/SRC/dgerfsx.f Tue Apr 7 20:05:18 2009 @@ -35,8 +35,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/dla_gbrcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_gbrcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_gbrcond.f (original) +++ lapack/trunk/SRC/dla_gbrcond.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ DOUBLE PRECISION FUNCTION DLA_GBRCOND( TRANS, N, KL, KU, AB, LDAB, - $ AFB, LDAFB, IPIV, CMODE, C, INFO, - $ WORK, IWORK ) + $ AFB, LDAFB, IPIV, CMODE, C, + $ INFO, WORK, IWORK ) * * -- LAPACK routine (version 3.2.1) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -38,9 +38,64 @@ * Arguments * ========= * -* WORK double precision workspace of size 5*N. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) DOUBLE PRECISION array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) DOUBLE PRECISION array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by DGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by DGBTRF; row i of the matrix was interchanged +* with row IPIV(i). * -* IWORK integer workspace of size N. +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) DOUBLE PRECISION array, dimension (5*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * @@ -74,13 +129,13 @@ ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'DLA_GBRCOND', -INFO ) Modified: lapack/trunk/SRC/dla_gbrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_gbrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_gbrfsx_extended.f (original) +++ lapack/trunk/SRC/dla_gbrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,10 +1,10 @@ SUBROUTINE DLA_GBRFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, KL, KU, $ NRHS, AB, LDAB, AFB, LDAFB, IPIV, $ COLEQU, C, B, LDB, Y, LDY, - $ BERR_OUT, N_NORMS, ERRS_N, ERRS_C, - $ RES, AYB, DY, Y_TAIL, RCOND, - $ ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ BERR_OUT, N_NORMS, ERR_BNDS_NORM, + $ ERR_BNDS_COMP, RES, AYB, DY, + $ Y_TAIL, RCOND, ITHRESH, RTHRESH, + $ DZ_UB, IGNORE_CWISE, INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +27,264 @@ DOUBLE PRECISION AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), $ Y( LDY, * ), RES(*), DY(*), Y_TAIL(*) DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT(*), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* DLA_GBRFSX_EXTENDED computes ... . +* DLA_GBRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by DGBRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0 +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by DGBTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by DGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) DOUBLE PRECISION array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by DGBTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by DLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to DGBTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -275,10 +522,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/dla_gbrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_gbrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_gbrpvgrw.f (original) +++ lapack/trunk/SRC/dla_gbrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ - DOUBLE PRECISION FUNCTION DLA_GBRPVGRW( N, KL, KU, NCOLS, AB, - $ LDAB, AFB, LDAFB ) + DOUBLE PRECISION FUNCTION DLA_GBRPVGRW( N, KL, KU, NCOLS, AB, + $ LDAB, AFB, LDAFB ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -20,12 +20,49 @@ * * Purpose * ======= -* -* DLA_GBRPVGRW computes ... . +* +* DLA_GBRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* AB (input) DOUBLE PRECISION array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) DOUBLE PRECISION array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by DGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* * ===================================================================== * * .. Local Scalars .. @@ -38,7 +75,7 @@ * .. Executable Statements .. * RPVGRW = 1.0D+0 -* + KD = KU + 1 DO J = 1, NCOLS AMAX = 0.0D+0 Modified: lapack/trunk/SRC/dla_gercond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_gercond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_gercond.f (original) +++ lapack/trunk/SRC/dla_gercond.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ - DOUBLE PRECISION FUNCTION DLA_GERCOND ( TRANS, N, A, LDA, AF, - $ LDAF, IPIV, CMODE, C, INFO, WORK, - $ IWORK ) + DOUBLE PRECISION FUNCTION DLA_GERCOND ( TRANS, N, A, LDA, AF, + $ LDAF, IPIV, CMODE, C, + $ INFO, WORK, IWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -38,9 +38,52 @@ * Arguments * ========== * -* WORK DOUBLE PRECISION workspace of size 3*N, and +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by DGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by DGETRF; row i of the matrix was interchanged +* with row IPIV(i). * -* IWORK INTEGER workspace of size N. +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) DOUBLE PRECISION array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * @@ -73,6 +116,10 @@ INFO = -1 ELSE IF( N.LT.0 ) THEN INFO = -2 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -4 + ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN + INFO = -6 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'DLA_GERCOND', -INFO ) Modified: lapack/trunk/SRC/dla_gerfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_gerfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_gerfsx_extended.f (original) +++ lapack/trunk/SRC/dla_gerfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -32,11 +32,251 @@ * Purpose * ======= * -* DLA_GERFSX_EXTENDED computes ... . +* DLA_GERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by DGERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by DGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by DGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) DOUBLE PRECISION array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by DGETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by DLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to DGETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/dla_lin_berr.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_lin_berr.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_lin_berr.f (original) +++ lapack/trunk/SRC/dla_lin_berr.f Tue Apr 7 20:05:18 2009 @@ -21,12 +21,39 @@ * Purpose * ======= * -* DLA_LIN_BERR computes component-wise relative backward error from +* DLA_LIN_BERR computes componentwise relative backward error from * the formula * max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) -* where abs(Z) is the component-wise absolute value of the matrix +* where abs(Z) is the componentwise absolute value of the matrix * or vector Z. * +* Arguments +* ========== +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NZ (input) INTEGER +* We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to +* guard against spuriously zero residuals. Default value is N. +* +* NRHS (input) INTEGER +* The number of right hand sides, i.e., the number of columns +* of the matrices AYB, RES, and BERR. NRHS >= 0. +* +* RES (input) DOUBLE PRECISION array, dimension (N,NRHS) +* The residual matrix, i.e., the matrix R in the relative backward +* error formula above. +* +* AYB (input) DOUBLE PRECISION array, dimension (N, NRHS) +* The denominator in the relative backward error formula above, i.e., +* the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B +* are from iterative refinement (see dla_gerfsx_extended.f). +* +* RES (output) DOUBLE PRECISION array, dimension (NRHS) +* The componentwise relative backward error from the formula above. +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/dla_porcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_porcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_porcond.f (original) +++ lapack/trunk/SRC/dla_porcond.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ - DOUBLE PRECISION FUNCTION DLA_PORCOND( UPLO, N, A, LDA, AF, LDAF, - $ CMODE, C, INFO, WORK, IWORK ) + DOUBLE PRECISION FUNCTION DLA_PORCOND( UPLO, N, A, LDA, AF, LDAF, + $ CMODE, C, INFO, WORK, + $ IWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -37,9 +38,45 @@ * Arguments * ========== * -* WORK double precision workspace of size 3*N. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* IWORK integer workspace of size N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by DPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) DOUBLE PRECISION array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/dla_porfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_porfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_porfsx_extended.f (original) +++ lapack/trunk/SRC/dla_porfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE DLA_PORFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, COLEQU, C, B, LDB, Y, - $ LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -26,17 +27,250 @@ DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* DLA_PORFSX_EXTENDED computes ... . +* DLA_PORFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by DPORFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by DPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) DOUBLE PRECISION array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by DPOTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by DLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to DPOTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -270,10 +504,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/dla_porpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_porpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_porpvgrw.f (original) +++ lapack/trunk/SRC/dla_porpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ DOUBLE PRECISION FUNCTION DLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF, - $ LDAF, WORK ) + $ LDAF, WORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -22,11 +22,38 @@ * Purpose * ======= * -* DLA_PORPVGRW computes ... . +* DLA_PORPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by DPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* WORK (input) DOUBLE PRECISION array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/dla_rpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_rpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_rpvgrw.f (original) +++ lapack/trunk/SRC/dla_rpvgrw.f Tue Apr 7 20:05:18 2009 @@ -20,11 +20,36 @@ * Purpose * ======= * -* DLA_RPVGRW computes ... . +* DLA_RPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by DGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* * ===================================================================== * * .. Local Scalars .. @@ -37,7 +62,7 @@ * .. Executable Statements .. * RPVGRW = 1.0D+0 -* + DO J = 1, NCOLS AMAX = 0.0D+0 UMAX = 0.0D+0 Modified: lapack/trunk/SRC/dla_syrcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_syrcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_syrcond.f (original) +++ lapack/trunk/SRC/dla_syrcond.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ DOUBLE PRECISION FUNCTION DLA_SYRCOND( UPLO, N, A, LDA, AF, LDAF, - $ IPIV, CMODE, C, INFO, WORK, IWORK ) + $ IPIV, CMODE, C, INFO, WORK, + $ IWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -36,9 +37,49 @@ * Arguments * ========== * -* WORK double precision workspace of size 3*N. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* IWORK integer workspace of size N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by DSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by DSYTRF. +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) DOUBLE PRECISION array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * @@ -160,9 +201,9 @@ END DO IF ( UP ) THEN - call dsytrs( 'U', n, 1, af, ldaf, ipiv, work, n, info ) + CALL DSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ELSE - call dsytrs( 'L', n, 1, af, ldaf, ipiv, work, n, info ) + CALL DSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ENDIF * * Multiply by inv(C). @@ -191,9 +232,9 @@ END IF IF ( UP ) THEN - call dsytrs( 'U', n, 1, af, ldaf, ipiv, work, n, info ) + CALL DSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ELSE - call dsytrs( 'L', n, 1, af, ldaf, ipiv, work, n, info ) + CALL DSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ENDIF * * Multiply by R. Modified: lapack/trunk/SRC/dla_syrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_syrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_syrfsx_extended.f (original) +++ lapack/trunk/SRC/dla_syrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE DLA_SYRFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,254 @@ DOUBLE PRECISION A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* DLA_SYRFSX_EXTENDED computes ... . +* DLA_SYRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by DSYRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by DSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by DSYTRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) DOUBLE PRECISION array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) DOUBLE PRECISION array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by DSYTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by DLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) DOUBLE PRECISION array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to DSYTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -271,10 +509,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/dla_syrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dla_syrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dla_syrpvgrw.f (original) +++ lapack/trunk/SRC/dla_syrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ DOUBLE PRECISION FUNCTION DLA_SYRPVGRW( UPLO, N, INFO, A, LDA, AF, - $ LDAF, IPIV, WORK ) + $ LDAF, IPIV, WORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -23,11 +23,50 @@ * Purpose * ======= * -* DLA_SYRPVGRW computes ... . +* DLA_SYRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from DSYTRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by DSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by DSYTRF. +* +* WORK (input) DOUBLE PRECISION array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/dlarscl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dlarscl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dlarscl2.f (original) +++ lapack/trunk/SRC/dlarscl2.f Tue Apr 7 20:05:18 2009 @@ -24,22 +24,30 @@ * x <-- inv(D) * x * where the diagonal matrix D is stored as a vector. * -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* Eventually to be replaced by BLAS_dge_diag_scale in the new BLAS * standard. * * Arguments * ========= * -* N (input) INTEGER -* The size of the vectors X and D. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. * -* D (input) DOUBLE PRECISION array, length N -* Diagonal matrix D, stored as a vector of length N. +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) DOUBLE PRECISION array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) DOUBLE PRECISION array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== * -* X (input/output) DOUBLE PRECISION array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. * .. Local Scalars .. INTEGER I, J * .. @@ -47,9 +55,9 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) / D(I) + X( I, J ) = X( I, J ) / D( I ) END DO END DO -* + RETURN END Modified: lapack/trunk/SRC/dlascl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dlascl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dlascl2.f (original) +++ lapack/trunk/SRC/dlascl2.f Tue Apr 7 20:05:18 2009 @@ -24,22 +24,30 @@ * x <-- D * x * where the diagonal matrix D is stored as a vector. * -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* Eventually to be replaced by BLAS_dge_diag_scale in the new BLAS * standard. * * Arguments * ========= * -* N (input) INTEGER -* The size of the vectors X and D. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. * -* D (input) DOUBLE PRECISION array, length N -* Diagonal matrix D, stored as a vector of length N. +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) DOUBLE PRECISION array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) DOUBLE PRECISION array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== * -* X (input/output) DOUBLE PRECISION array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. * .. Local Scalars .. INTEGER I, J * .. @@ -47,9 +55,9 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) * D(I) + X( I, J ) = X( I, J ) * D( I ) END DO END DO -* + RETURN END Modified: lapack/trunk/SRC/dporfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dporfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dporfsx.f (original) +++ lapack/trunk/SRC/dporfsx.f Tue Apr 7 20:05:18 2009 @@ -36,7 +36,8 @@ * definite, and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS for details of the error bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/dsyrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dsyrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dsyrfsx.f (original) +++ lapack/trunk/SRC/dsyrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,7 +36,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/dsysvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/dsysvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/dsysvxx.f (original) +++ lapack/trunk/SRC/dsysvxx.f Tue Apr 7 20:05:18 2009 @@ -114,6 +114,10 @@ * = 'E': The matrix A will be equilibrated if necessary, then * copied to AF and factored. * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0. Modified: lapack/trunk/SRC/sgbrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sgbrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sgbrfsx.f (original) +++ lapack/trunk/SRC/sgbrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,8 +36,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/sgerfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sgerfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sgerfsx.f (original) +++ lapack/trunk/SRC/sgerfsx.f Tue Apr 7 20:05:18 2009 @@ -35,8 +35,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/sla_gbrcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_gbrcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_gbrcond.f (original) +++ lapack/trunk/SRC/sla_gbrcond.f Tue Apr 7 20:05:18 2009 @@ -37,9 +37,64 @@ * Arguments * ========== * -* WORK real workspace of size 5*N. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) REAL array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) REAL array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by SGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by SGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* IWORK integer workspace of size N. +* WORK (input) REAL array, dimension (5*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * @@ -73,13 +128,13 @@ ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'SLA_GBRCOND', -INFO ) Modified: lapack/trunk/SRC/sla_gbrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_gbrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_gbrfsx_extended.f (original) +++ lapack/trunk/SRC/sla_gbrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,10 +1,10 @@ SUBROUTINE SLA_GBRFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, KL, KU, $ NRHS, AB, LDAB, AFB, LDAFB, IPIV, $ COLEQU, C, B, LDB, Y, LDY, - $ BERR_OUT, N_NORMS, ERRS_N, ERRS_C, - $ RES, AYB, DY, Y_TAIL, RCOND, - $ ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ BERR_OUT, N_NORMS, ERR_BNDS_NORM, + $ ERR_BNDS_COMP, RES, AYB, DY, + $ Y_TAIL, RCOND, ITHRESH, RTHRESH, + $ DZ_UB, IGNORE_CWISE, INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +27,263 @@ REAL AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), $ Y( LDY, * ), RES(*), DY(*), Y_TAIL(*) REAL C( * ), AYB(*), RCOND, BERR_OUT(*), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* SLA_GBRFSX_EXTENDED computes ... . +* SLA_GBRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by SGBRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0 +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by SGBTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by SGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) REAL array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) REAL array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by SGBTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by SLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) REAL array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) REAL array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) REAL array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to SGBTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -275,10 +521,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/sla_gbrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_gbrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_gbrpvgrw.f (original) +++ lapack/trunk/SRC/sla_gbrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -20,12 +20,49 @@ * * Purpose * ======= -* -* SLA_GBRPVGRW computes ... . +* +* SLA_GBRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* AB (input) REAL array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) REAL array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by SGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* * ===================================================================== * * .. Local Scalars .. @@ -38,7 +75,7 @@ * .. Executable Statements .. * RPVGRW = 1.0 -* + KD = KU + 1 DO J = 1, NCOLS AMAX = 0.0 Modified: lapack/trunk/SRC/sla_gercond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_gercond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_gercond.f (original) +++ lapack/trunk/SRC/sla_gercond.f Tue Apr 7 20:05:18 2009 @@ -37,9 +37,52 @@ * Arguments * ========== * -* WORK REAL workspace of size 3*N. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by SGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by SGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* IWORK INTEGER workspace of size N. +* WORK (input) REAL array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace.2 * * ===================================================================== * @@ -72,6 +115,10 @@ INFO = -1 ELSE IF( N.LT.0 ) THEN INFO = -2 + ELSE IF( LDA.LT.MAX( 1, N ) ) THEN + INFO = -4 + ELSE IF( LDAF.LT.MAX( 1, N ) ) THEN + INFO = -6 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'SLA_GERCOND', -INFO ) Modified: lapack/trunk/SRC/sla_gerfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_gerfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_gerfsx_extended.f (original) +++ lapack/trunk/SRC/sla_gerfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE SLA_GERFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, NRHS, A, $ LDA, AF, LDAF, IPIV, COLEQU, C, B, $ LDB, Y, LDY, BERR_OUT, N_NORMS, - $ ERRS_N, ERRS_C, RES, AYB, DY, - $ Y_TAIL, RCOND, ITHRESH, RTHRESH, - $ DZ_UB, IGNORE_CWISE, INFO ) + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -26,17 +27,255 @@ REAL A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* SLA_GERFSX_EXTENDED computes ... . +* +* SLA_GERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by SGERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by SGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by SGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) REAL array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) REAL array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by SGETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by SLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) REAL array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) REAL array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) REAL array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to SGETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -270,10 +509,12 @@ * Compute error bounds * IF (N_NORMS .GE. 1) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/sla_lin_berr.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_lin_berr.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_lin_berr.f (original) +++ lapack/trunk/SRC/sla_lin_berr.f Tue Apr 7 20:05:18 2009 @@ -21,12 +21,39 @@ * Purpose * ======= * -* SLA_LIN_BERR computes component-wise relative backward error from +* SLA_LIN_BERR computes componentwise relative backward error from * the formula * max(i) ( abs(R(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) -* where abs(Z) is the component-wise absolute value of the matrix +* where abs(Z) is the componentwise absolute value of the matrix * or vector Z. * +* Arguments +* ========== +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NZ (input) INTEGER +* We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to +* guard against spuriously zero residuals. Default value is N. +* +* NRHS (input) INTEGER +* The number of right hand sides, i.e., the number of columns +* of the matrices AYB, RES, and BERR. NRHS >= 0. +* +* RES (input) REAL array, dimension (N,NRHS) +* The residual matrix, i.e., the matrix R in the relative backward +* error formula above. +* +* AYB (input) REAL array, dimension (N, NRHS) +* The denominator in the relative backward error formula above, i.e., +* the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B +* are from iterative refinement (see sla_gerfsx_extended.f). +* +* RES (output) REAL array, dimension (NRHS) +* The componentwise relative backward error from the formula above. +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/sla_porcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_porcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_porcond.f (original) +++ lapack/trunk/SRC/sla_porcond.f Tue Apr 7 20:05:18 2009 @@ -37,9 +37,45 @@ * Arguments * ========== * -* WORK real workspace of size 3*N, and +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* IWORK integer workspace of size N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by SPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) REAL array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/sla_porfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_porfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_porfsx_extended.f (original) +++ lapack/trunk/SRC/sla_porfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE SLA_PORFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, COLEQU, C, B, LDB, Y, - $ LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -26,17 +27,247 @@ REAL A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB(*), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* SLA_PORFSX_EXTENDED computes ... . +* SLA_PORFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by SPORFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by SPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) REAL array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) REAL array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by SPOTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by SLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) REAL array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) REAL array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) REAL array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to SPOTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -270,10 +501,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/sla_porpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_porpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_porpvgrw.f (original) +++ lapack/trunk/SRC/sla_porpvgrw.f Tue Apr 7 20:05:18 2009 @@ -21,11 +21,38 @@ * Purpose * ======= * -* SLA_PORPVGRW computes ... . +* SLA_PORPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by SPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* WORK (input) REAL array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/sla_rpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_rpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_rpvgrw.f (original) +++ lapack/trunk/SRC/sla_rpvgrw.f Tue Apr 7 20:05:18 2009 @@ -19,12 +19,37 @@ * * Purpose * ======= -* -* SLA_RPVGRW computes ... . +* +* SLA_RPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by SGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* * ===================================================================== * * .. Local Scalars .. @@ -37,7 +62,7 @@ * .. Executable Statements .. * RPVGRW = 1.0 -* + DO J = 1, NCOLS AMAX = 0.0 UMAX = 0.0 Modified: lapack/trunk/SRC/sla_syrcond.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_syrcond.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_syrcond.f (original) +++ lapack/trunk/SRC/sla_syrcond.f Tue Apr 7 20:05:18 2009 @@ -36,9 +36,49 @@ * Arguments * ========== * -* WORK real workspace of size 3*N. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* IWORK integer workspace of size N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by SSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by SSYTRF. +* +* CMODE (input) INTEGER +* Determines op2(C) in the formula op(A) * op2(C) as follows: +* CMODE = 1 op2(C) = C +* CMODE = 0 op2(C) = I +* CMODE = -1 op2(C) = inv(C) +* +* C (input) REAL array, dimension (N) +* The vector C in the formula op(A) * op2(C). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) REAL array, dimension (3*N). +* Workspace. +* +* IWORK (input) INTEGER array, dimension (N). +* Workspace. * * ===================================================================== * @@ -160,9 +200,9 @@ END DO IF ( UP ) THEN - call ssytrs( 'U', n, 1, af, ldaf, ipiv, work, n, info ) + CALL SSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ELSE - call ssytrs( 'L', n, 1, af, ldaf, ipiv, work, n, info ) + CALL SSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ENDIF * * Multiply by inv(C). @@ -191,9 +231,9 @@ END IF IF ( UP ) THEN - call ssytrs( 'U', n, 1, af, ldaf, ipiv, work, n, info ) + CALL SSYTRS( 'U', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ELSE - call ssytrs( 'L', n, 1, af, ldaf, ipiv, work, n, info ) + CALL SSYTRS( 'L', N, 1, AF, LDAF, IPIV, WORK, N, INFO ) ENDIF * * Multiply by R. Modified: lapack/trunk/SRC/sla_syrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_syrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_syrfsx_extended.f (original) +++ lapack/trunk/SRC/sla_syrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE SLA_SYRFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,251 @@ REAL A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) REAL C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* SLA_SYRFSX_EXTENDED computes ... . +* SLA_SYRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by SSYRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by SSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by SSYTRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) REAL array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) REAL array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) REAL array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by SSYTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) REAL array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by SLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) REAL array, dimension (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) REAL array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) REAL array, dimension (N) +* Workspace. This can be the same workspace passed for Y_TAIL. +* +* DY (input) REAL array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) REAL array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) REAL +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) REAL +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) REAL +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to SSYTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -271,10 +506,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/sla_syrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sla_syrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sla_syrpvgrw.f (original) +++ lapack/trunk/SRC/sla_syrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -23,11 +23,50 @@ * Purpose * ======= * -* SLA_SYRPVGRW computes ... . +* SLA_SYRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from SSYTRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) REAL array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) REAL array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by SSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by SSYTRF. +* +* WORK (input) REAL array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/slarscl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/slarscl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/slarscl2.f (original) +++ lapack/trunk/SRC/slarscl2.f Tue Apr 7 20:05:18 2009 @@ -30,16 +30,24 @@ * Arguments * ========= * -* N (input) INTEGER -* The size of the vectors X and D. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. * -* D (input) REAL array, length N -* Diagonal matrix D, stored as a vector of length N. +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) REAL array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) REAL array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== * -* X (input/output) REAL array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. * .. Local Scalars .. INTEGER I, J * .. @@ -47,9 +55,9 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) / D(I) + X( I, J ) = X( I, J ) / D( I ) END DO END DO -* + RETURN END Modified: lapack/trunk/SRC/slascl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/slascl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/slascl2.f (original) +++ lapack/trunk/SRC/slascl2.f Tue Apr 7 20:05:18 2009 @@ -30,16 +30,24 @@ * Arguments * ========= * -* N (input) INTEGER -* The size of the vectors X and D. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. * -* D (input) REAL array, length N -* Diagonal matrix D, stored as a vector of length N. +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) REAL array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) REAL array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== * -* X (input/output) REAL array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. * .. Local Scalars .. INTEGER I, J * .. @@ -47,9 +55,9 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) * D(I) + X( I, J ) = X( I, J ) * D( I ) END DO END DO -* + RETURN END Modified: lapack/trunk/SRC/sporfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/sporfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/sporfsx.f (original) +++ lapack/trunk/SRC/sporfsx.f Tue Apr 7 20:05:18 2009 @@ -36,7 +36,8 @@ * definite, and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS for details of the error bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/ssyrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/ssyrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/ssyrfsx.f (original) +++ lapack/trunk/SRC/ssyrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,7 +36,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/ssysvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/ssysvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/ssysvxx.f (original) +++ lapack/trunk/SRC/ssysvxx.f Tue Apr 7 20:05:18 2009 @@ -114,6 +114,10 @@ * = 'E': The matrix A will be equilibrated if necessary, then * copied to AF and factored. * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0. Modified: lapack/trunk/SRC/zgbrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zgbrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zgbrfsx.f (original) +++ lapack/trunk/SRC/zgbrfsx.f Tue Apr 7 20:05:18 2009 @@ -36,8 +36,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/zgerfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zgerfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zgerfsx.f (original) +++ lapack/trunk/SRC/zgerfsx.f Tue Apr 7 20:05:18 2009 @@ -35,8 +35,8 @@ * equations and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS_N and ERR_BNDS_C for details of the error -* bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED, R Modified: lapack/trunk/SRC/zherfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zherfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zherfsx.f (original) +++ lapack/trunk/SRC/zherfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine ZHERFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, + SUBROUTINE ZHERFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, $ S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -35,7 +35,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/zhesvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zhesvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zhesvxx.f (original) +++ lapack/trunk/SRC/zhesvxx.f Tue Apr 7 20:05:18 2009 @@ -155,7 +155,7 @@ * IPIV (input or output) INTEGER array, dimension (N) * If FACT = 'F', then IPIV is an input argument and on entry * contains details of the interchanges and the block -* structure of D, as determined by DSYTRF. If IPIV(k) > 0, +* structure of D, as determined by ZHETRF. If IPIV(k) > 0, * then rows and columns k and IPIV(k) were interchanged and * D(k,k) is a 1-by-1 diagonal block. If UPLO = 'U' and * IPIV(k) = IPIV(k-1) < 0, then rows and columns k-1 and @@ -166,7 +166,7 @@ * * If FACT = 'N', then IPIV is an output argument and on exit * contains details of the interchanges and the block -* structure of D, as determined by DSYTRF. +* structure of D, as determined by ZHETRF. * * EQUED (input or output) CHARACTER*1 * Specifies the form of equilibration that was done. Modified: lapack/trunk/SRC/zla_gbrcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gbrcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gbrcond_c.f (original) +++ lapack/trunk/SRC/zla_gbrcond_c.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,7 @@ - DOUBLE PRECISION FUNCTION ZLA_GBRCOND_C( TRANS, N, KL, KU, AB, - $ LDAB, AFB, LDAFB, IPIV, C, CAPPLY, - $ INFO, WORK, RWORK ) + DOUBLE PRECISION FUNCTION ZLA_GBRCOND_C( TRANS, N, KL, KU, AB, + $ LDAB, AFB, LDAFB, IPIV, + $ C, CAPPLY, INFO, WORK, + $ RWORK ) * * -- LAPACK routine (version 3.2.1) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -32,11 +33,61 @@ * Arguments * ========= * -* C DOUBLE PRECISION vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) COMPLEX*16 array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX*16 array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by ZGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX*16 workspace of size 2*N. +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. * -* RWORK DOUBLE PRECISION workspace of size N. +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * @@ -72,16 +123,17 @@ NOTRANS = LSAME( TRANS, 'N' ) IF ( .NOT. NOTRANS .AND. .NOT. LSAME( TRANS, 'T' ) .AND. .NOT. $ LSAME( TRANS, 'C' ) ) THEN + INFO = -1 ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'ZLA_GBRCOND_C', -INFO ) Modified: lapack/trunk/SRC/zla_gbrcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gbrcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gbrcond_x.f (original) +++ lapack/trunk/SRC/zla_gbrcond_x.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ DOUBLE PRECISION FUNCTION ZLA_GBRCOND_X( TRANS, N, KL, KU, AB, - $ LDAB, AFB, LDAFB, IPIV, X, INFO, - $ WORK, RWORK ) + $ LDAB, AFB, LDAFB, IPIV, + $ X, INFO, WORK, RWORK ) * * -- LAPACK routine (version 3.2.1) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -32,11 +32,58 @@ * Arguments * ========= * -* X COMPLEX*16 vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* AB (input) COMPLEX*16 array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX*16 array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by ZGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* X (input) COMPLEX*16 array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX*16 workspace of size 2*N. +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. * -* RWORK DOUBLE PRECISION workspace of size N. +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * @@ -77,13 +124,13 @@ ELSE IF( N.LT.0 ) THEN INFO = -2 ELSE IF( KL.LT.0 .OR. KL.GT.N-1 ) THEN - INFO = -4 + INFO = -3 ELSE IF( KU.LT.0 .OR. KU.GT.N-1 ) THEN - INFO = -5 + INFO = -4 ELSE IF( LDAB.LT.KL+KU+1 ) THEN - INFO = -8 + INFO = -6 ELSE IF( LDAFB.LT.2*KL+KU+1 ) THEN - INFO = -10 + INFO = -8 END IF IF( INFO.NE.0 ) THEN CALL XERBLA( 'ZLA_GBRCOND_X', -INFO ) Modified: lapack/trunk/SRC/zla_gbrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gbrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gbrfsx_extended.f (original) +++ lapack/trunk/SRC/zla_gbrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,10 +1,10 @@ SUBROUTINE ZLA_GBRFSX_EXTENDED( PREC_TYPE, TRANS_TYPE, N, KL, KU, $ NRHS, AB, LDAB, AFB, LDAFB, IPIV, $ COLEQU, C, B, LDB, Y, LDY, - $ BERR_OUT, N_NORMS, ERRS_N, ERRS_C, - $ RES, AYB, DY, Y_TAIL, RCOND, - $ ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ BERR_OUT, N_NORMS, ERR_BNDS_NORM, + $ ERR_BNDS_COMP, RES, AYB, DY, + $ Y_TAIL, RCOND, ITHRESH, RTHRESH, + $ DZ_UB, IGNORE_CWISE, INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +27,263 @@ COMPLEX*16 AB( LDAB, * ), AFB( LDAFB, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB(*), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* ZLA_GBRFSX_EXTENDED computes ... . +* +* ZLA_GBRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by ZGBRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0 +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* AB (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDAB (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AFB (input) COMPLEX*16 array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by ZGBTRF. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGBTRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX*16 array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX*16 array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by ZGBTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by ZLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to ZGBTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -282,10 +528,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/zla_gbrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gbrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gbrpvgrw.f (original) +++ lapack/trunk/SRC/zla_gbrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ - DOUBLE PRECISION FUNCTION ZLA_GBRPVGRW( N, KL, KU, NCOLS, AB, - $ LDAB, AFB, LDAFB ) + DOUBLE PRECISION FUNCTION ZLA_GBRPVGRW( N, KL, KU, NCOLS, AB, + $ LDAB, AFB, LDAFB ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -20,12 +20,49 @@ * * Purpose * ======= -* -* ZLA_GBRPVGRW computes ... . +* +* ZLA_GBRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* KL (input) INTEGER +* The number of subdiagonals within the band of A. KL >= 0. +* +* KU (input) INTEGER +* The number of superdiagonals within the band of A. KU >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* AB (input) COMPLEX*16 array, dimension (LDAB,N) +* On entry, the matrix A in band storage, in rows 1 to KL+KU+1. +* The j-th column of A is stored in the j-th column of the +* array AB as follows: +* AB(KU+1+i-j,j) = A(i,j) for max(1,j-KU)<=i<=min(N,j+kl) +* +* LDAB (input) INTEGER +* The leading dimension of the array AB. LDAB >= KL+KU+1. +* +* AFB (input) COMPLEX*16 array, dimension (LDAFB,N) +* Details of the LU factorization of the band matrix A, as +* computed by ZGBTRF. U is stored as an upper triangular +* band matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, +* and the multipliers used during the factorization are stored +* in rows KL+KU+2 to 2*KL+KU+1. +* +* LDAFB (input) INTEGER +* The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1. +* * ===================================================================== * * .. Local Scalars .. @@ -45,7 +82,7 @@ * .. Executable Statements .. * RPVGRW = 1.0D+0 -* + KD = KU + 1 DO J = 1, NCOLS AMAX = 0.0D+0 Modified: lapack/trunk/SRC/zla_gercond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gercond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gercond_c.f (original) +++ lapack/trunk/SRC/zla_gercond_c.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ DOUBLE PRECISION FUNCTION ZLA_GERCOND_C( TRANS, N, A, LDA, AF, - $ LDAF, IPIV, C, CAPPLY, INFO, WORK, - $ RWORK ) + $ LDAF, IPIV, C, CAPPLY, + $ INFO, WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -32,11 +32,49 @@ * Arguments * ========= * -* C DOUBLE PRECISION vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by ZGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_gercond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gercond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gercond_x.f (original) +++ lapack/trunk/SRC/zla_gercond_x.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ - DOUBLE PRECISION FUNCTION ZLA_GERCOND_X( TRANS, N, A, LDA, AF, - $ LDAF, IPIV, X, INFO, WORK, RWORK ) + DOUBLE PRECISION FUNCTION ZLA_GERCOND_X( TRANS, N, A, LDA, AF, + $ LDAF, IPIV, X, INFO, + $ WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -30,11 +31,46 @@ * Arguments * ========= * -* C COMPLEX*16 vector. +* TRANS (input) CHARACTER*1 +* Specifies the form of the system of equations: +* = 'N': A * X = B (No transpose) +* = 'T': A**T * X = B (Transpose) +* = 'C': A**H * X = B (Conjugate Transpose = Transpose) +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by ZGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* X (input) COMPLEX*16 array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. * -* WORK COMPLEX*16 workspace of size 2*N. +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. * -* RWORK DOUBLE PRECISION workspace of size N. +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_gerfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_gerfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_gerfsx_extended.f (original) +++ lapack/trunk/SRC/zla_gerfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -32,12 +32,251 @@ * * Purpose * ======= -* -* ZLA_GERFSX_EXTENDED computes ... . +* +* ZLA_GERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by ZGERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* TRANS_TYPE (input) INTEGER +* Specifies the transposition operation on A. +* The value is defined by ILATRANS(T) where T is a CHARACTER and +* T = 'N': No transpose +* = 'T': Transpose +* = 'C': Conjugate transpose +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by ZGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* The pivot indices from the factorization A = P*L*U +* as computed by ZGETRF; row i of the matrix was interchanged +* with row IPIV(i). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX*16 array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX*16 array, dimension (LDY,NRHS) +* On entry, the solution matrix X, as computed by ZGETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by ZLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to ZGETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/zla_hercond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_hercond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_hercond_c.f (original) +++ lapack/trunk/SRC/zla_hercond_c.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ DOUBLE PRECISION FUNCTION ZLA_HERCOND_C( UPLO, N, A, LDA, AF, - $ LDAF, IPIV, C, CAPPLY, INFO, WORK, - $ RWORK ) + $ LDAF, IPIV, C, CAPPLY, + $ INFO, WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -32,11 +32,46 @@ * Arguments * ========= * -* C DOUBLE PRECISION vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_hercond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_hercond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_hercond_x.f (original) +++ lapack/trunk/SRC/zla_hercond_x.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ - DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, N, A, LDA, AF, - $ LDAF, IPIV, X, INFO, WORK, RWORK ) + DOUBLE PRECISION FUNCTION ZLA_HERCOND_X( UPLO, N, A, LDA, AF, + $ LDAF, IPIV, X, INFO, + $ WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -30,11 +31,43 @@ * Arguments * ========= * -* C COMPLEX*16 vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by CHETRF. +* +* X (input) COMPLEX*16 array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_herfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_herfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_herfsx_extended.f (original) +++ lapack/trunk/SRC/zla_herfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE ZLA_HERFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,254 @@ COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* ZLA_HERFSX_EXTENDED computes ... . +* ZLA_HERFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by ZHERFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZHETRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX*16 array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX*16 array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by ZHETRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by ZLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to ZHETRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -88,7 +326,7 @@ DOUBLE PRECISION DLAMCH * .. * .. Intrinsic Functions .. - INTRINSIC ABS, REAL, DIMAG, MAX, MIN + INTRINSIC ABS, DBLE, DIMAG, MAX, MIN * .. * .. Statement Functions .. DOUBLE PRECISION CABS1 @@ -280,10 +518,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/zla_herpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_herpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_herpvgrw.f (original) +++ lapack/trunk/SRC/zla_herpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ DOUBLE PRECISION FUNCTION ZLA_HERPVGRW( UPLO, N, INFO, A, LDA, AF, - $ LDAF, IPIV, WORK ) + $ LDAF, IPIV, WORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -24,11 +24,50 @@ * Purpose * ======= * -* ZLA_HERPVGRW computes ... . +* ZLA_HERPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from ZHETRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZHETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZHETRF. +* +* WORK (input) COMPLEX*16 array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/zla_lin_berr.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_lin_berr.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_lin_berr.f (original) +++ lapack/trunk/SRC/zla_lin_berr.f Tue Apr 7 20:05:18 2009 @@ -27,6 +27,30 @@ * where abs(Z) is the componentwise absolute value of the matrix * or vector Z. * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NZ (input) INTEGER +* We add (NZ+1)*SLAMCH( 'Safe minimum' ) to R(i) in the numerator to +* guard against spuriously zero residuals. Default value is N. +* +* NRHS (input) INTEGER +* The number of right hand sides, i.e., the number of columns +* of the matrices AYB, RES, and BERR. NRHS >= 0. +* +* RES (input) DOUBLE PRECISION array, dimension (N,NRHS) +* The residual matrix, i.e., the matrix R in the relative backward +* error formula above. +* +* AYB (input) DOUBLE PRECISION array, dimension (N, NRHS) +* The denominator in the relative backward error formula above, i.e., +* the matrix abs(op(A_s))*abs(Y) + abs(B_s). The matrices A, Y, and B +* are from iterative refinement (see zla_gerfsx_extended.f). +* +* RES (output) COMPLEX*16 array, dimension (NRHS) +* The componentwise relative backward error from the formula above. +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/zla_porcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_porcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_porcond_c.f (original) +++ lapack/trunk/SRC/zla_porcond_c.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ DOUBLE PRECISION FUNCTION ZLA_PORCOND_C( UPLO, N, A, LDA, AF, - $ LDAF, C, CAPPLY, INFO, WORK, RWORK ) + $ LDAF, C, CAPPLY, INFO, + $ WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -24,17 +25,48 @@ * Purpose * ======= * -* DLA_PORCOND_C Computes the infinity norm condition number of +* ZLA_PORCOND_C Computes the infinity norm condition number of * op(A) * inv(diag(C)) where C is a DOUBLE PRECISION vector * * Arguments * ========= * -* C DOUBLE PRECISION vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by ZPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_porcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_porcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_porcond_x.f (original) +++ lapack/trunk/SRC/zla_porcond_x.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ - DOUBLE PRECISION FUNCTION ZLA_PORCOND_X( UPLO, N, A, LDA, AF, - $ LDAF, X, INFO, WORK, RWORK ) + DOUBLE PRECISION FUNCTION ZLA_PORCOND_X( UPLO, N, A, LDA, AF, + $ LDAF, X, INFO, WORK, + $ RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -29,11 +30,39 @@ * Arguments * ========= * -* C COMPLEX*16 vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by ZPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* X (input) COMPLEX*16 array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_porfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_porfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_porfsx_extended.f (original) +++ lapack/trunk/SRC/zla_porfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE ZLA_PORFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, COLEQU, C, B, LDB, Y, - $ LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -26,18 +27,250 @@ COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= * -* ZLA_PORFSX_EXTENDED computes ... . +* ZLA_PORFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by ZPORFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * - +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by ZPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX*16 array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX*16 array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by ZPOTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by ZLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX*16 PRECISION array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to ZPOTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -88,7 +321,7 @@ DOUBLE PRECISION DLAMCH * .. * .. Intrinsic Functions .. - INTRINSIC ABS, REAL, DIMAG, MAX, MIN + INTRINSIC ABS, DBLE, DIMAG, MAX, MIN * .. * .. Statement Functions .. DOUBLE PRECISION CABS1 @@ -280,10 +513,12 @@ * Compute error bounds. * IF (N_NORMS .GE. 1) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF (N_NORMS .GE. 2) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/zla_porpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_porpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_porpvgrw.f (original) +++ lapack/trunk/SRC/zla_porpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ DOUBLE PRECISION FUNCTION ZLA_PORPVGRW( UPLO, NCOLS, A, LDA, AF, - $ LDAF, WORK ) + $ LDAF, WORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -23,11 +23,38 @@ * Purpose * ======= * -* ZLA_PORPVGRW computes ... . +* ZLA_PORPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The triangular factor U or L from the Cholesky factorization +* A = U**T*U or A = L*L**T, as computed by ZPOTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* WORK (input) COMPLEX*16 array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/zla_rpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_rpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_rpvgrw.f (original) +++ lapack/trunk/SRC/zla_rpvgrw.f Tue Apr 7 20:05:18 2009 @@ -20,11 +20,36 @@ * Purpose * ======= * -* ZLA_RPVGRW computes ... . +* ZLA_RPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) DOUBLE PRECISION array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) DOUBLE PRECISION array, dimension (LDAF,N) +* The factors L and U from the factorization +* A = P*L*U as computed by ZGETRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* * ===================================================================== * * .. Local Scalars .. @@ -44,7 +69,7 @@ * .. Executable Statements .. * RPVGRW = 1.0D+0 -* + DO J = 1, NCOLS AMAX = 0.0D+0 UMAX = 0.0D+0 Modified: lapack/trunk/SRC/zla_syrcond_c.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_syrcond_c.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_syrcond_c.f (original) +++ lapack/trunk/SRC/zla_syrcond_c.f Tue Apr 7 20:05:18 2009 @@ -1,6 +1,6 @@ - DOUBLE PRECISION FUNCTION ZLA_SYRCOND_C( UPLO, N, A, LDA, AF, - $ LDAF, IPIV, C, CAPPLY, INFO, WORK, - $ RWORK ) + DOUBLE PRECISION FUNCTION ZLA_SYRCOND_C( UPLO, N, A, LDA, AF, + $ LDAF, IPIV, C, CAPPLY, + $ INFO, WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -32,11 +32,46 @@ * Arguments * ========= * -* C DOUBLE PRECISION vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZSYTRF. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The vector C in the formula op(A) * inv(diag(C)). +* +* CAPPLY (input) LOGICAL +* If .TRUE. then access the vector C in the formula above. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_syrcond_x.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_syrcond_x.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_syrcond_x.f (original) +++ lapack/trunk/SRC/zla_syrcond_x.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,6 @@ - DOUBLE PRECISION FUNCTION ZLA_SYRCOND_X( UPLO, N, A, LDA, AF, - $ LDAF, IPIV, X, INFO, WORK, RWORK ) + DOUBLE PRECISION FUNCTION ZLA_SYRCOND_X( UPLO, N, A, LDA, AF, + $ LDAF, IPIV, X, INFO, + $ WORK, RWORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -30,11 +31,43 @@ * Arguments * ========= * -* C COMPLEX*16 vector. +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. * -* WORK COMPLEX*16 workspace of size 2*N. +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. * -* RWORK DOUBLE PRECISION workspace of size N. +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZSYTRF. +* +* X (input) COMPLEX*16 array, dimension (N) +* The vector X in the formula op(A) * diag(X). +* +* INFO (output) INTEGER +* = 0: Successful exit. +* i > 0: The ith argument is invalid. +* +* WORK (input) COMPLEX*16 array, dimension (2*N). +* Workspace. +* +* RWORK (input) DOUBLE PRECISION array, dimension (N). +* Workspace. * * ===================================================================== * Modified: lapack/trunk/SRC/zla_syrfsx_extended.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_syrfsx_extended.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_syrfsx_extended.f (original) +++ lapack/trunk/SRC/zla_syrfsx_extended.f Tue Apr 7 20:05:18 2009 @@ -1,9 +1,10 @@ SUBROUTINE ZLA_SYRFSX_EXTENDED( PREC_TYPE, UPLO, N, NRHS, A, LDA, $ AF, LDAF, IPIV, COLEQU, C, B, LDB, - $ Y, LDY, BERR_OUT, N_NORMS, ERRS_N, - $ ERRS_C, RES, AYB, DY, Y_TAIL, - $ RCOND, ITHRESH, RTHRESH, DZ_UB, - $ IGNORE_CWISE, INFO ) + $ Y, LDY, BERR_OUT, N_NORMS, + $ ERR_BNDS_NORM, ERR_BNDS_COMP, RES, + $ AYB, DY, Y_TAIL, RCOND, ITHRESH, + $ RTHRESH, DZ_UB, IGNORE_CWISE, + $ INFO ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -27,17 +28,254 @@ COMPLEX*16 A( LDA, * ), AF( LDAF, * ), B( LDB, * ), $ Y( LDY, * ), RES( * ), DY( * ), Y_TAIL( * ) DOUBLE PRECISION C( * ), AYB( * ), RCOND, BERR_OUT( * ), - $ ERRS_N( NRHS, * ), ERRS_C( NRHS, * ) + $ ERR_BNDS_NORM( NRHS, * ), + $ ERR_BNDS_COMP( NRHS, * ) * .. * * Purpose * ======= -* -* ZLA_SYRFSX_EXTENDED computes ... . +* +* ZLA_SYRFSX_EXTENDED improves the computed solution to a system of +* linear equations by performing extra-precise iterative refinement +* and provides error bounds and backward error estimates for the solution. +* This subroutine is called by ZSYRFSX to perform iterative refinement. +* In addition to normwise error bound, the code provides maximum +* componentwise error bound if possible. See comments for ERR_BNDS_NORM +* and ERR_BNDS_COMP for details of the error bounds. Note that this +* subroutine is only resonsible for setting the second fields of +* ERR_BNDS_NORM and ERR_BNDS_COMP. * * Arguments * ========= * +* PREC_TYPE (input) INTEGER +* Specifies the intermediate precision to be used in refinement. +* The value is defined by ILAPREC(P) where P is a CHARACTER and +* P = 'S': Single +* = 'D': Double +* = 'I': Indigenous +* = 'X', 'E': Extra +* +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* NRHS (input) INTEGER +* The number of right-hand-sides, i.e., the number of columns of the +* matrix B. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZSYTRF. +* +* COLEQU (input) LOGICAL +* If .TRUE. then column equilibration was done to A before calling +* this routine. This is needed to compute the solution and error +* bounds correctly. +* +* C (input) DOUBLE PRECISION array, dimension (N) +* The column scale factors for A. If COLEQU = .FALSE., C +* is not accessed. If C is input, each element of C should be a power +* of the radix to ensure a reliable solution and error estimates. +* Scaling by powers of the radix does not cause rounding errors unless +* the result underflows or overflows. Rounding errors during scaling +* lead to refining with a matrix that is not equivalent to the +* input matrix, producing error estimates that may not be +* reliable. +* +* B (input) COMPLEX*16 array, dimension (LDB,NRHS) +* The right-hand-side matrix B. +* +* LDB (input) INTEGER +* The leading dimension of the array B. LDB >= max(1,N). +* +* Y (input/output) COMPLEX*16 array, dimension +* (LDY,NRHS) +* On entry, the solution matrix X, as computed by ZSYTRS. +* On exit, the improved solution matrix Y. +* +* LDY (input) INTEGER +* The leading dimension of the array Y. LDY >= max(1,N). +* +* BERR_OUT (output) DOUBLE PRECISION array, dimension (NRHS) +* On exit, BERR_OUT(j) contains the componentwise relative backward +* error for right-hand-side j from the formula +* max(i) ( abs(RES(i)) / ( abs(op(A_s))*abs(Y) + abs(B_s) )(i) ) +* where abs(Z) is the componentwise absolute value of the matrix +* or vector Z. This is computed by ZLA_LIN_BERR. +* +* N_NORMS (input) INTEGER +* Determines which error bounds to return (see ERR_BNDS_NORM +* and ERR_BNDS_COMP). +* If N_NORMS >= 1 return normwise error bounds. +* If N_NORMS >= 2 return componentwise error bounds. +* +* ERR_BNDS_NORM (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* normwise relative error, which is defined as follows: +* +* Normwise relative error in the ith solution vector: +* max_j (abs(XTRUE(j,i) - X(j,i))) +* ------------------------------ +* max_j abs(X(j,i)) +* +* The array is indexed by the type of error information as described +* below. There currently are up to three pieces of information +* returned. +* +* The first index in ERR_BNDS_NORM(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_NORM(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated normwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*A, where S scales each row by a power of the +* radix so all absolute row sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* ERR_BNDS_COMP (input/output) DOUBLE PRECISION array, dimension +* (NRHS, N_ERR_BNDS) +* For each right-hand side, this array contains information about +* various error bounds and condition numbers corresponding to the +* componentwise relative error, which is defined as follows: +* +* Componentwise relative error in the ith solution vector: +* abs(XTRUE(j,i) - X(j,i)) +* max_j ---------------------- +* abs(X(j,i)) +* +* The array is indexed by the right-hand side i (on which the +* componentwise relative error depends), and the type of error +* information as described below. There currently are up to three +* pieces of information returned for each right-hand side. If +* componentwise accuracy is not requested (PARAMS(3) = 0.0), then +* ERR_BNDS_COMP is not accessed. If N_ERR_BNDS .LT. 3, then at most +* the first (:,N_ERR_BNDS) entries are returned. +* +* The first index in ERR_BNDS_COMP(i,:) corresponds to the ith +* right-hand side. +* +* The second index in ERR_BNDS_COMP(:,err) contains the following +* three fields: +* err = 1 "Trust/don't trust" boolean. Trust the answer if the +* reciprocal condition number is less than the threshold +* sqrt(n) * slamch('Epsilon'). +* +* err = 2 "Guaranteed" error bound: The estimated forward error, +* almost certainly within a factor of 10 of the true error +* so long as the next entry is greater than the threshold +* sqrt(n) * slamch('Epsilon'). This error bound should only +* be trusted if the previous boolean is true. +* +* err = 3 Reciprocal condition number: Estimated componentwise +* reciprocal condition number. Compared with the threshold +* sqrt(n) * slamch('Epsilon') to determine if the error +* estimate is "guaranteed". These reciprocal condition +* numbers are 1 / (norm(Z^{-1},inf) * norm(Z,inf)) for some +* appropriately scaled matrix Z. +* Let Z = S*(A*diag(x)), where x is the solution for the +* current right-hand side and S scales each row of +* A*diag(x) by a power of the radix so all absolute row +* sums of Z are approximately 1. +* +* This subroutine is only responsible for setting the second field +* above. +* See Lapack Working Note 165 for further details and extra +* cautions. +* +* RES (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate residual. +* +* AYB (input) DOUBLE PRECISION array, dimension (N) +* Workspace. +* +* DY (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the intermediate solution. +* +* Y_TAIL (input) COMPLEX*16 array, dimension (N) +* Workspace to hold the trailing bits of the intermediate solution. +* +* RCOND (input) DOUBLE PRECISION +* Reciprocal scaled condition number. This is an estimate of the +* reciprocal Skeel condition number of the matrix A after +* equilibration (if done). If this is less than the machine +* precision (in particular, if it is zero), the matrix is singular +* to working precision. Note that the error may still be small even +* if this number is very small and the matrix appears ill- +* conditioned. +* +* ITHRESH (input) INTEGER +* The maximum number of residual computations allowed for +* refinement. The default is 10. For 'aggressive' set to 100 to +* permit convergence using approximate factorizations or +* factorizations other than LU. If the factorization uses a +* technique other than Gaussian elimination, the guarantees in +* ERR_BNDS_NORM and ERR_BNDS_COMP may no longer be trustworthy. +* +* RTHRESH (input) DOUBLE PRECISION +* Determines when to stop refinement if the error estimate stops +* decreasing. Refinement will stop when the next solution no longer +* satisfies norm(dx_{i+1}) < RTHRESH * norm(dx_i) where norm(Z) is +* the infinity norm of Z. RTHRESH satisfies 0 < RTHRESH <= 1. The +* default value is 0.5. For 'aggressive' set to 0.9 to permit +* convergence on extremely ill-conditioned matrices. See LAWN 165 +* for more details. +* +* DZ_UB (input) DOUBLE PRECISION +* Determines when to start considering componentwise convergence. +* Componentwise convergence is only considered after each component +* of the solution Y is stable, which we definte as the relative +* change in each component being less than DZ_UB. The default value +* is 0.25, requiring the first bit to be stable. See LAWN 165 for +* more details. +* +* IGNORE_CWISE (input) LOGICAL +* If .TRUE. then ignore componentwise convergence. Default value +* is .FALSE.. +* +* INFO (output) INTEGER +* = 0: Successful exit. +* < 0: if INFO = -i, the ith argument to ZSYTRS had an illegal +* value +* * ===================================================================== * * .. Local Scalars .. @@ -149,7 +387,7 @@ $ Y( 1, J ), 1, DCMPLX(1.0D+0), RES, 1, PREC_TYPE ) ELSE CALL BLAS_ZSYMV2_X(UPLO2, N, DCMPLX(-1.0D+0), A, LDA, - $ Y(1, J), Y_TAIL, 1, DCMPLX(1.0D+0), RES, 1, + $ Y(1, J), Y_TAIL, 1, DCMPLX(1.0D+0), RES, 1, $ PREC_TYPE) END IF @@ -280,10 +518,12 @@ * Compute error bounds. * IF ( N_NORMS .GE. 1 ) THEN - ERRS_N( J, LA_LINRX_ERR_I ) = FINAL_DX_X / (1 - DXRATMAX) + ERR_BNDS_NORM( J, LA_LINRX_ERR_I ) = + $ FINAL_DX_X / (1 - DXRATMAX) END IF IF ( N_NORMS .GE. 2 ) THEN - ERRS_C( J, LA_LINRX_ERR_I ) = FINAL_DZ_Z / (1 - DZRATMAX) + ERR_BNDS_COMP( J, LA_LINRX_ERR_I ) = + $ FINAL_DZ_Z / (1 - DZRATMAX) END IF * * Compute componentwise relative backward error from formula Modified: lapack/trunk/SRC/zla_syrpvgrw.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zla_syrpvgrw.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zla_syrpvgrw.f (original) +++ lapack/trunk/SRC/zla_syrpvgrw.f Tue Apr 7 20:05:18 2009 @@ -1,5 +1,5 @@ DOUBLE PRECISION FUNCTION ZLA_SYRPVGRW( UPLO, N, INFO, A, LDA, AF, - $ LDAF, IPIV, WORK ) + $ LDAF, IPIV, WORK ) * * -- LAPACK routine (version 3.2) -- * -- Contributed by James Demmel, Deaglan Halligan, Yozo Hida and -- @@ -24,11 +24,50 @@ * Purpose * ======= * -* ZLA_SYRPVGRW computes ... . +* ZLA_SYRPVGRW computes the reciprocal pivot growth factor +* norm(A)/norm(U). The "max absolute element" norm is used. If this is +* much less than 1, the stability of the LU factorization of the +* (equilibrated) matrix A could be poor. This also means that the +* solution X, estimated condition numbers, and error bounds could be +* unreliable. * * Arguments * ========= * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* +* N (input) INTEGER +* The number of linear equations, i.e., the order of the +* matrix A. N >= 0. +* +* INFO (input) INTEGER +* The value of INFO returned from ZSYTRF, .i.e., the pivot in +* column INFO is exactly 0. +* +* NCOLS (input) INTEGER +* The number of columns of the matrix A. NCOLS >= 0. +* +* A (input) COMPLEX*16 array, dimension (LDA,N) +* On entry, the N-by-N matrix A. +* +* LDA (input) INTEGER +* The leading dimension of the array A. LDA >= max(1,N). +* +* AF (input) COMPLEX*16 array, dimension (LDAF,N) +* The block diagonal matrix D and the multipliers used to +* obtain the factor U or L as computed by ZSYTRF. +* +* LDAF (input) INTEGER +* The leading dimension of the array AF. LDAF >= max(1,N). +* +* IPIV (input) INTEGER array, dimension (N) +* Details of the interchanges and the block structure of D +* as determined by ZSYTRF. +* +* WORK (input) COMPLEX*16 array, dimension (2*N) +* * ===================================================================== * * .. Local Scalars .. Modified: lapack/trunk/SRC/zlarscl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zlarscl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zlarscl2.f (original) +++ lapack/trunk/SRC/zlarscl2.f Tue Apr 7 20:05:18 2009 @@ -23,21 +23,32 @@ * * ZLARSCL2 performs a reciprocal diagonal scaling on an vector: * x <-- inv(D) * x -* where the diagonal matrix D is stored as a vector. -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* where the DOUBLE PRECISION diagonal matrix D is stored as a vector. +* +* Eventually to be replaced by BLAS_zge_diag_scale in the new BLAS * standard. * * Arguments * ========= -* N (input) INTEGER -* The size of the vectors X and D. * -* D (input) DOUBLE PRECISION array, length N -* Diagonal matrix D, stored as a vector of length N. -* X (input/output) COMPLEX*16 array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. +* +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) DOUBLE PRECISION array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) COMPLEX*16 array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== +* * .. Local Scalars .. INTEGER I, J * .. @@ -45,10 +56,10 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) / D(I) + X( I, J ) = X( I, J ) / D( I ) END DO END DO -* + RETURN END -* + Modified: lapack/trunk/SRC/zlascl2.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zlascl2.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zlascl2.f (original) +++ lapack/trunk/SRC/zlascl2.f Tue Apr 7 20:05:18 2009 @@ -23,21 +23,32 @@ * * ZLASCL2 performs a diagonal scaling on a vector: * x <-- D * x -* where the diagonal matrix D is stored as a vector. -* Eventually to be replaced by BLAS_sge_diag_scale in the new BLAS +* where the DOUBLE PRECISION diagonal matrix D is stored as a vector. +* +* Eventually to be replaced by BLAS_zge_diag_scale in the new BLAS * standard. * * Arguments * ========= -* N (input) INTEGER -* The size of the vectors X and D. * -* D (input) DOUBLE PRECISION array, length N -* Diagonal matrix D, stored as a vector of length N. -* X (input/output) COMPLEX*16 array, length N -* On entry, the vector X to be scaled by D. -* On exit, the scaled vector. -* .. +* M (input) INTEGER +* The number of rows of D and X. M >= 0. +* +* N (input) INTEGER +* The number of columns of D and X. N >= 0. +* +* D (input) DOUBLE PRECISION array, length M +* Diagonal matrix D, stored as a vector of length M. +* +* X (input/output) COMPLEX*16 array, dimension (LDX,N) +* On entry, the vector X to be scaled by D. +* On exit, the scaled vector. +* +* LDX (input) INTEGER +* The leading dimension of the vector X. LDX >= 0. +* +* ===================================================================== +* * .. Local Scalars .. INTEGER I, J * .. @@ -45,10 +56,10 @@ * DO J = 1, N DO I = 1, M - X(I,J) = X(I,J) * D(I) + X( I, J ) = X( I, J ) * D( I ) END DO END DO -* + RETURN END -* + Modified: lapack/trunk/SRC/zporfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zporfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zporfsx.f (original) +++ lapack/trunk/SRC/zporfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine ZPORFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B, + SUBROUTINE ZPORFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, S, B, $ LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -35,7 +35,8 @@ * definite, and provides error bounds and backward error estimates * for the solution. In addition to normwise error bound, the code * provides maximum componentwise error bound if possible. See -* comments for ERR_BNDS for details of the error bounds. +* comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the +* error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/zsyrfsx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zsyrfsx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zsyrfsx.f (original) +++ lapack/trunk/SRC/zsyrfsx.f Tue Apr 7 20:05:18 2009 @@ -1,4 +1,4 @@ - Subroutine ZSYRFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, + SUBROUTINE ZSYRFSX( UPLO, EQUED, N, NRHS, A, LDA, AF, LDAF, IPIV, $ S, B, LDB, X, LDX, RCOND, BERR, N_ERR_BNDS, $ ERR_BNDS_NORM, ERR_BNDS_COMP, NPARAMS, PARAMS, $ WORK, RWORK, INFO ) @@ -36,7 +36,7 @@ * provides error bounds and backward error estimates for the * solution. In addition to normwise error bound, the code provides * maximum componentwise error bound if possible. See comments for -* ERR_BNDS_N and ERR_BNDS_C for details of the error bounds. +* ERR_BNDS_NORM and ERR_BNDS_COMP for details of the error bounds. * * The original system of linear equations may have been equilibrated * before calling this routine, as described by arguments EQUED and S Modified: lapack/trunk/SRC/zsysvxx.f URL: https://icl.cs.utk.edu/trac/lapack-dev/file/lapack/trunk/SRC/zsysvxx.f?rev=650 ============================================================================== --- lapack/trunk/SRC/zsysvxx.f (original) +++ lapack/trunk/SRC/zsysvxx.f Tue Apr 7 20:05:18 2009 @@ -115,6 +115,10 @@ * = 'E': The matrix A will be equilibrated if necessary, then * copied to AF and factored. * +* UPLO (input) CHARACTER*1 +* = 'U': Upper triangle of A is stored; +* = 'L': Lower triangle of A is stored. +* * N (input) INTEGER * The number of linear equations, i.e., the order of the * matrix A. N >= 0.