Uses extra precise iterative refinement to improve the solution to the system of linear equations with a general coefficient matrix A and provides error bounds and backward error estimates.
The routine improves the computed solution to a system of linear equations and provides error bounds and backward error estimates for the solution. In addition to a normwise error bound, the code provides a maximum componentwise error bound, if possible. See comments for
err_bnds_compfor details of the error bounds.
The original system of linear equations may have been equilibrated before calling this routine, as described by the parameters
cbelow. In this case, the solution and error bounds returned are for the original unequilibrated system.
- Specifies whether two-dimensional array storage is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- Must be'N','T', or'C'.Specifies the form of the system of equations:If, the system has the formtrans='N'(No transpose).A*X=BIf, the system has the formtrans='T'(Transpose).AT*X=BIf, the system has the formtrans='C'(Conjugate transpose for complex flavors, Transpose for real flavors).AH*X=B
- Must be'N','R','C', or'B'.Specifies the form of equilibration that was done toAbefore calling this routine.If, no equilibration was done.equed='N'If, row equilibration was done, that is,equed='R'Ahas been premultiplied bydiag(r).If, column equilibration was done, that is,equed='C'Ahas been postmultiplied bydiag(c).If, both row and column equilibration was done, that is,equed='B'Ahas been replaced by. The right-hand sidediag(r)*A*diag(c)Bhas been changed accordingly.
- The number of linear equations; the order of the matrixA;n≥0.
- The number of right-hand sides; the number of columns of the matricesBandX;nrhs≥0.
- Arrays:a(size max(1,,lda*n))af(size max(1,,ldaf*n))b(size max(1,.ldb*nrhs) for column major layout and max(1,ldb*n) for row major layout)The arrayacontains the originaln-by-nmatrixA.The arrayafcontains the factored form of the matrixA, that is, the factorsLandUfrom the factorizationas computed byA=P*L*U?getrf.The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations.
- The leading dimension ofa;.lda≥max(1,n)
- The leading dimension ofaf;.ldaf≥max(1,n)
- Arrays:r(sizen),c(sizen). The arrayrcontains the row scale factors forA, and the arrayccontains the column scale factors forA.orequed='R''B',Ais multiplied on the left bydiag(r); iforequed='N''C',ris not accessed.Ifequed='R'or'B', each element ofrmust be positive.Iforequed='C''B',Ais multiplied on the right bydiag(c); iforequed='N''R',cis not accessed.Ifequed='C'or'B', each element ofcmust be positive.Each element ofrorcshould 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.
- The leading dimension of the arrayb;.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout
- Array,of size max(1,.ldx*nrhs) for column major layout and max(1,ldx*n) for row major layoutThe solution matrixXas computed by?getrs
- The leading dimension of the output arrayx;.ldx≥max(1,n) for column major layout andldx≥nrhsfor row major layout
- Number of error bounds to return for each right hand side and each type (normwise or componentwise). Seeerr_bnds_normanderr_bnds_compdescriptions inOutput Argumentssection below.
- Specifies the number of parameters set inparams. If≤0, theparamsarray is never referenced and default values are used.
- Array, sizenparams. Specifies algorithm parameters. If an entry is less than 0.0, that entry is filled with the default value used for that parameter. Only positions up tonparamsare accessed; defaults are used for higher-numbered parameters. If defaults are acceptable, you can passnparams= 0, which prevents the source code from accessing theparamsargument.: Whether to perform iterative refinement or not. Default: 1.0params
(Other values are reserved for future use.): Maximum number of residual computations allowed for refinement.params
- No refinement is performed and no error bounds are computed.
- Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support double precision.
: Flag determining if the code will attempt to find a solution with a small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false. Default: 1.0 (attempt componentwise convergence).params
- Set to 100.0 to permit convergence using approximate factorizations or factorizations other thanLU. If the factorization uses a technique other than Gaussian elimination, the guarantees inerr_bnds_normanderr_bnds_compmay no longer be trustworthy.
- The improved solution matrixX.
- Reciprocal scaled condition number. An estimate of the reciprocal Skeel condition number of the matrixAafter equilibration (if done). Ifrcondis less than the machine precision, in particular, ifrcond= 0, 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.
- Array, size at leastmax(1,. Contains the componentwise relative backward error for each solution vectornrhs), that is, the smallest relative change in any element ofxjAorBthat makesan exact solution.xj
- Array of size. For each right-hand side, contains information about various error bounds and condition numbers corresponding to the normwise relative errornrhs*n_err_bnds, which is defined as follows:Normwise relative error in thei-th solution vectorThe array is indexed by the type of error information as described below. There are currently up to three pieces of information returned.
The information for right-hand sidei, where 1≤i≤nrhs, and type of errorerris stored in:
- "Trust/don't trust" boolean. Trust the answer if the reciprocal condition number is less than the thresholdfor single precision flavors andsqrt(n)*slamch(ε)for double precision flavors.sqrt(n)*dlamch(ε)
- "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 thresholdfor single precision flavors andsqrt(n)*slamch(ε)for double precision flavors. This error bound should only be trusted if the previous boolean is true.sqrt(n)*dlamch(ε)
- Reciprocal condition number. Estimated normwise reciprocal condition number. Compared with the thresholdfor single precision flavors andsqrt(n)*slamch(ε)for double precision flavors to determine if the error estimate is "guaranteed". These reciprocal condition numbers for some appropriately scaled matrixsqrt(n)*dlamch(ε)Zare:Letz=s*a, wheresscales each row by a power of the radix so all absolute row sums ofzare approximately 1.
- Column major layout:.err_bnds_norm[(err- 1)*nrhs+i- 1]
- Row major layout:err_bnds_norm[err- 1 + (i- 1)*n_err_bnds]