LU Computational Routines APIs#

GECON#

group gecon

Functions

template<typename T>
void gecon(char *norm, integer *n, T *a, integer *lda, T *anorm, T *rcond, T *work, integer *iwork, integer *info)#

GECON estimates the reciprocal of the condition number of a general real matrix A.

Purpose:

 GECON estimates the reciprocal of the condition number of a general
 real matrix A, in either the 1-norm or the infinity-norm, using
 the LU factorization computed by SGETRF.

 An estimate is obtained for norm(inv(A)), and the reciprocal of the
 condition number is computed as
    RCOND = 1 / ( norm(A) * norm(inv(A))).

Parameters:
  • NORM – [in]

    NORM is CHARACTER*1

    Specifies whether the 1-norm condition number or the infinity-norm condition number is required:

    = ‘1’ or ‘O’: 1-norm;

    = ‘I’: Infinity-norm.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The factors L and U from the factorization A = P*L*U as computed by SGETRF.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • ANORM – [in]

    ANORM is REAL

    If NORM = ‘1’ or ‘O’, the 1-norm of the original matrix A.

    If NORM = ‘I’, the infinity-norm of the original matrix A.

  • RCOND – [out]

    RCOND is REAL

    The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).

  • WORK – [out] WORK is REAL array, dimension (4*N)

  • IWORK – [out] IWORK is INTEGER array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gecon(char *norm, integer *n, T *a, integer *lda, Ta *anorm, Ta *rcond, T *work, Ta *rwork, integer *info)#

GETRF#

group getrf

Functions

template<typename T>
void getrf(integer *m, integer *n, T *a, integer *lda, integer *ipiv, integer *info)#

LU factorization of a general m-by-n matrix a using partial pivoting with row interchanges.

Purpose:

    LU factorization of a general m-by-n matrix a using partial pivoting with row interchanges.
    The factorization has the form
        A = P * L * U
    where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower
    trapezoidal if M >  , and U is upper triangular (upper trapezoidal if M < N).

    This is the right-looking Level 3 BLAS version of the algorithm.

Parameters:
  • m – [in]

    m is integer*

    The number of rows of the matrix a. m >= 0.

  • n – [in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • a – [inout]

    a is REAL/DOUBLE PRECISION/COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the m-by-n matrix to be factored.

    On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored.

  • lda – [in]

    lda is integer*

    The leading dimension of the matrix a, lda >= fla_max(1,m)

  • ipiv – [out]

    ipiv is integer array, dimension (min(m,n))

    The pivot indices; for 1 <= i <= min(m,n), row i of the matrix was interchanged with row ipiv(i).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GETRF2#

group getrf2

Functions

template<typename T>
void getrf2(integer *m, integer *n, T *a, integer *lda, integer *ipiv, integer *info)#

GETRF2 computes an LU factorization of a general M-by-N matrix A.

Purpose:

 GETRF2 computes an LU factorization of a general M-by-N matrix A
 using partial pivoting with row interchanges.
 The factorization has the form
    A = P * L * U
 where P is a permutation matrix, L is lower triangular with unit
 diagonal elements (lower trapezoidal if m > n), and U is upper
 triangular (upper trapezoidal if m < n).
 This is the recursive version of the algorithm. It divides
 the matrix into four submatrices:
        [  A11 | A12  ]  where A11 is n1 by n1 and A22 is n2 by n2
    A = [ -----|----- ]  with n1 = min(m,n)/2
        [  A21 | A22  ]       n2 = n-n1
                                       [ A11 ]
 The subroutine calls itself to factor [ --- ],
                                       [ A12 ]
                 [ A12 ]
 do the swaps on [ --- ], solve A12, update A22,
                 [ A22 ]
 then calls itself to factor A22 and do the swaps on A21.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M-by-N matrix to be factored.

    On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • IPIV – [out]

    IPIV is INTEGER array, dimension (min(M,N))

    The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GETF2#

group getf2

Functions

template<typename T>
void getf2(integer *m, integer *n, T *a, integer *lda, integer *ipiv, integer *info)#

LU factorization of a general m-by-n matrix a using partial pivoting with row interchanges.

Purpose:

    LU factorization of a general m-by-n matrix a using partial pivoting with row interchanges.
    The factorization has the form
        A = P * L * U
    where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower
    trapezoidal if M > N), and U is upper triangular (upper trapezoidal if M < N).

    This is the right-looking Level 2 BLAS version of the algorithm.

Parameters:
  • m – [in]

    m is integer*

    The number of rows of the matrix a. m >= 0.

  • n – [in]

    n is integer*

    The number of columns of the matrix a. n >= 0.

  • a – [inout]

    a is REAL/DOUBLE PRECISION/COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the m-by-n matrix to be factored.

    On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored.

  • lda – [in]

    lda is integer*

    The leading dimension of the matrix a, lda >= fla_max(1,m)

  • ipiv – [out]

    ipiv is integer array, dimension (min(m,n))

    ipiv is integer array, dimension (min(m,n))

    The pivot indices; for 1 <= i <= min(m,n), row i of the matrix was interchanged with row ipiv(i).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GETRS#

group getrs

Functions

template<typename T>
void getrs(char *trans, integer *n, integer *nrhs, T *a, integer *lda, integer *ipiv, T *b, integer *ldb, integer *info)#

GETRS solves a system of linear equations.

Purpose:

  GETRS solves a system of linear equations
     A * X = B  or  A**T * X = B
  with a general N-by-N matrix A using the LU factorization computed
  by GETRF.

Parameters:
  • TRANS – [in]

    TRANS is CHARACTER*1

    Specifies the form of the system of equations:

    = ‘N’: A * X = B (No transpose)

    = ‘T’: A**T* X = B (Transpose)

    = ‘C’: A**T* X = B (Conjugate transpose = Transpose)

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The factors L and U from the factorization A = P*L*U as computed by GETRF.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices from GETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the right hand side matrix B. On exit, the solution matrix X.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GETRI#

group getri

Functions

template<typename T>
void getri(integer *n, T *a, integer *lda, integer *ipiv, T *work, integer *lwork, integer *info)#

GETRI computes the inverse of a matrix using the LU factorization computed by GETRF.

Purpose:

    GETRI computes the inverse of a matrix using the LU factorization
    computed by GETRF.

    This method inverts U and then computes inv(A) by solving the system
    inv(A)*L = inv(U) for inv(A).

Parameters:
  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the factors L and U from the factorization A = P*L*U as computed by GETRF.

    On exit, if INFO = 0, the inverse of the original matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices from GETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • WORK – [out]

    WORK is COMPLEX array, dimension (MAX(1,LWORK))

    On exit, if INFO=0, then WORK(1) returns the optimal LWORK.

  • LWORK – [in]

    LWORK is INTEGER

    The dimension of the array WORK. LWORK >= fla_max(1,N). For optimal performance LWORK >= N*NB, where NB is the optimal blocksize returned by ILAENV.

    If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.

GERFS#

group gerfs

Functions

template<typename T>
void gerfs(char *trans, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, T *ferr, T *berr, T *work, integer *iwork, integer *info)#

GERFS improves the computed solution to a system of linear equations

and provides error bounds and backward error estimates for the solution.

Purpose:

  GERFS improves the computed solution to a system of linear
  equations and provides error bounds and backward error estimates for
  the solution.

Parameters:
  • TRANS – [in]

    TRANS is 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 – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The original N-by-N matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AF – [in]

    AF is REAL array, dimension (LDAF,N)

    The factors L and U from the factorization A = P*L*U as computed by GETRF.

  • LDAF – [in]

    LDAF is INTEGER

    The leading dimension of the array AF. LDAF >= fla_max(1,N).

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices from GETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • B – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right hand side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • X – [inout]

    X is REAL array, dimension (LDX,NRHS)

    On entry, the solution matrix X, as computed by GETRS. On exit, the improved solution matrix X.

  • LDX – [in]

    LDX is INTEGER

    The leading dimension of the array X. LDX >= fla_max(1,N).

  • FERR – [out]

    FERR is REAL array, dimension (NRHS)

    The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

  • BERR – [out]

    BERR is REAL array, dimension (NRHS)

    The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

  • WORK – [out] WORK is COMPLEX array, dimension (2*N)

  • RWORK – [out] RWORK is REAL array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gerfs(char *trans, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#

GERFSX#

group gerfsx

Functions

template<typename T>
void gerfsx(char *trans, char *equed, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, T *r, T *c, T *b, integer *ldb, T *x, integer *ldx, T *rcond, T *berr, integer *n_err_bnds, T *err_bnds_norm, T *err_bnds_comp, integer *nparams, T *params, T *work, integer *iwork, integer *info)#

GERFSX improves the computed solution to a system of linear equations

and provides error bounds and backward error estimates for the solution.

Purpose:

    GERFSX improves the computed solution to a system of linear
    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_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
    and C below. In this case, the solution and error bounds returned
    are for the original unequilibrated system.

Parameters:
  • TRANS – [in]

    TRANS is 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)

  • EQUED – [in]

    EQUED is CHARACTER*1

    Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.

    = ‘N’: No equilibration

    = ‘R’: Row equilibration, i.e., A has been premultiplied by diag(R).

    = ‘C’: Column equilibration, i.e., A has been postmultiplied by diag(C).

    = ‘B’: Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The original N-by-N matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AF – [in]

    AF is REAL array, dimension (LDAF,N)

    The factors L and U from the factorization A = P*L*U as computed by GETRF.

  • LDAF – [in]

    LDAF is INTEGER

    The leading dimension of the array AF. LDAF >= fla_max(1,N).

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices from GETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • R – [in]

    R is REAL array, dimension (N)

    The row scale factors for A. If EQUED = ‘R’ or ‘B’, A is multiplied on the left by diag(R); if EQUED = ‘N’ or ‘C’, R is not accessed.

    If R is accessed, each element of R 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.

  • C – [in]

    C is REAL array, dimension (N)

    The column scale factors for A. If EQUED = ‘C’ or ‘B’, A is multiplied on the right by diag(C); if EQUED = ‘N’ or ‘R’, C is not accessed.

    If C is accessed, 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 – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right hand side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • X – [inout]

    X is REAL array, dimension (LDX,NRHS)

    On entry, the solution matrix X, as computed by GETRS. On exit, the improved solution matrix X.

  • LDX – [in]

    LDX is INTEGER

    The leading dimension of the array X. LDX >= fla_max(1,N).

  • RCOND – [out]

    RCOND is 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.

  • BERR – [out]

    BERR is REAL array, dimension (NRHS)

    Componentwise relative backward error. This is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

  • N_ERR_BNDS – [in]

    N_ERR_BNDS is INTEGER

    Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below.

  • ERR_BNDS_NORM – [out]

    ERR_BNDS_NORM is 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:

    \[ \frac{{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.

    See Lapack Working Note 165 for further details and extra cautions.

  • ERR_BNDS_COMP – [out]

    ERR_BNDS_COMP is 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:
    \[{max\_j}\ \frac{abs(XTRUE(j,i) - X(j,i))}{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 < 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.

    See Lapack Working Note 165 for further details and extra cautions.

  • NPARAMS – [in]

    NPARAMS is INTEGER

    Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used.

  • PARAMS – [inout]

    PARAMS is REAL array, dimension NPARAMS

    Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.

    PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative refinement or not.

    Default: 1.0

    = 0.0: No refinement is performed, and no error bounds are computed.

    = 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION. (other values are reserved for future use)

    PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual computations allowed for refinement.

    Default: 10

    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.

    PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false.

    Default: 1.0 (attempt componentwise convergence)

  • WORK – [out] WORK is COMPLEX array, dimension (2*N)

  • RWORK – [out] RWORK is REAL array, dimension (2*N)

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit. The solution to every right-hand side is guaranteed.

    < 0: If INFO = -i, the i-th argument had an illegal value

    > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned.

    = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right- hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.

template<typename T, typename Ta>
void gerfsx(char *trans, char *equed, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, Ta *r, Ta *c, T *b, integer *ldb, T *x, integer *ldx, Ta *rcond, Ta *berr, integer *n_err_bnds, Ta *err_bnds_norm, Ta *err_bnds_comp, integer *nparams, Ta *params, T *work, Ta *rwork, integer *info)#

GEEQU#

group geequ

Functions

template<typename T>
void geequ(integer *m, integer *n, T *a, integer *lda, T *r, T *c, T *rowcnd, T *colcnd, T *amax, integer *info)#

GEEQU computes row and column scalings intended to equilibrate an

M-by-N matrix A and reduce its condition number.

Purpose:

  GEEQU computes row and column scalings intended to equilibrate an
  M-by-N matrix A and reduce its condition number.  R returns the row
  scale factors and C the column scale factors, chosen to try to make
  the largest element in each row and column of the matrix B with
  elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.

  R(i) and C(j) are restricted to be between SMLNUM = smallest safe
  number and BIGNUM = largest safe number.  Use of these scaling
  factors is not guaranteed to reduce the condition number of A but
  works well in practice.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The M-by-N matrix whose equilibration factors are to be computed.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • R – [out]

    R is REAL array, dimension (M)

    If INFO = 0 or INFO > M, R contains the row scale factors for A.

  • C – [out]

    C is REAL array, dimension (N)

    If INFO = 0, C contains the column scale factors for A.

  • ROWCND – [out]

    ROWCND is REAL

    If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

  • COLCND – [out]

    COLCND is REAL

    If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

  • AMAX – [out]

    AMAX is REAL

    Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, and i is

    <= M: the i-th row of A is exactly zero

    > M: the (i-M)-th column of A is exactly zero

template<typename T, typename Ta>
void geequ(integer *m, integer *n, T *a, integer *lda, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, integer *info)#

GEEQUB#

group geequb

Functions

template<typename T>
void geequb(integer *m, integer *n, T *a, integer *lda, T *r, T *c, T *rowcnd, T *colcnd, T *amax, integer *info)#

GEEQUB - computes row and column scaling to reduce condition number of matrix.

Purpose:

 GEEQUB computes row and column scalings intended to equilibrate an
 M-by-N matrix A and reduce its condition number.  R returns the row
 scale factors and C the column scale factors, chosen to try to make
 the largest element in each row and column of the matrix B with
 elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most
 the radix.

 R(i) and C(j) are restricted to be a power of the radix between
 SMLNUM = smallest safe number and BIGNUM = largest safe number.  Use
 of these scaling factors is not guaranteed to reduce the condition
 number of A but works well in practice.

 This routine differs from SGEEQU by restricting the scaling factors
 to a power of the radix.  Barring over- and underflow, scaling by
 these factors introduces no additional rounding errors.  However, the
 scaled entries' magnitudes are no longer approximately 1 but lie
 between sqrt(radix) and 1/sqrt(radix).

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The M-by-N matrix whose equilibration factors are to be computed.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,M).

  • R – [out]

    R is REAL array, dimension (M)

    If INFO = 0 or INFO > M, R contains the row scale factors for A.

  • C – [out]

    C is REAL array, dimension (N)

    If INFO = 0, C contains the column scale factors for A.

  • ROWCND – [out]

    ROWCND is REAL

    If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

  • COLCND – [out]

    COLCND is REAL

    If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

  • AMAX – [out]

    AMAX is REAL

    Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, and i is

    <= M: the i-th row of A is exactly zero

    > M: the (i-M)-th column of A is exactly zero

template<typename T, typename Ta>
void geequb(integer *m, integer *n, T *a, integer *lda, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, integer *info)#

LAQGE#

group laqge

Functions

template<typename T>
void laqge(integer *m, integer *n, T *a, integer *lda, T *r, T *c, T *rowcnd, T *colcnd, T *amax, char *equed)#

LAQGE scales a general rectangular matrix, using row and column scaling factors computed by geequ.

Purpose:

   LAQGE equilibrates a general M by N matrix A using the row and
   column scaling factors in the vectors R and C.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • A – [inout]

    A is REAL array, dimension (LDA,N)

    On entry, the M by N matrix A. On exit, the equilibrated matrix. See EQUED for the form of the equilibrated matrix.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(M,1).

  • R – [in]

    R is REAL array, dimension (M)

    The row scale factors for A.

  • C – [in]

    C is REAL array, dimension (N)

    The column scale factors for A.

  • ROWCND – [in]

    ROWCND is REAL

    Ratio of the smallest R(i) to the largest R(i).

  • COLCND – [in]

    COLCND is REAL

    Ratio of the smallest C(i) to the largest C(i).

  • AMAX – [in]

    AMAX is REAL

    Absolute value of largest matrix entry.

  • EQUED – [out]

    EQUED is CHARACTER*1

    Specifies the form of equilibration that was done.

    = ‘N’: No equilibration

    = ‘R’: Row equilibration, i.e., A has been premultiplied by diag(R).

    = ‘C’: Column equilibration, i.e., A has been postmultiplied by diag(C).

    = ‘B’: Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C).

template<typename T, typename Ta>
void laqge(integer *m, integer *n, T *a, integer *lda, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, char *equed)#

LASWP#

group laswp

Functions

template<typename T>
void laswp(integer *n, T *a, integer *lda, integer *k1, integer *k2, integer *ipiv, integer *incx)#

Swap rows.

Purpose:

 Perform a series of row interchanges on the matrix a.
 One row interchange is initiated for each of rows k1 through k2 of A.

Parameters:
  • n – [in]

    n is integer*

    The number of columns of the matrix a.

  • a – [inout]

    a is float/double/COMPLEX/COMPLEX*16 array, dimension (lda,n)

    On entry, the matrix of column dimension n to which the row interchanges will be applied.

    On exit, the permuted matrix.

  • lda – [in]

    lda is integer*

    The leading dimension of the array a.

  • k1 – [in]

    k1 is integer*

    The first element of ipiv for which a row interchange will be done.

  • k2 – [in]

    k2 is integer*

    (k2-k1+1) is the number of elements of ipiv for which a row interchange will be done.

  • ipiv – [in]

    ipiv is integer array, dimension (k1+(k2-k1)*abs(incx))

    The vector of pivot indices. Only the elements in positions k1 through k1+(k2-k1)*abs(incx) of ipiv are accessed.

    ipiv(k1+(K-k1)*abs(incx)) = L implies rows K and L are to be interchanged.

  • incx – [in]

    incx is integer*

    The increment between successive values of ipiv. If incx is negative, the pivots are applied in reverse order.

GESC2#

group gesc2

Functions

template<typename T>
void gesc2(integer *n, T *a, integer *lda, T *rhs, integer *ipiv, integer *jpiv, T *scale)#

GESC2 solves a system of linear equations using the LU factorization with complete pivoting computed by getc2.

Purpose:

   GESC2 solves a system of linear equations

             A * X = scale* RHS

   with a general N-by-N matrix A using the LU factorization with
   complete pivoting computed by GETC2.

Parameters:
  • N – [in]

    N is INTEGER

    The order of the matrix A.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    On entry, the LU part of the factorization of the n-by-n matrix A computed by SGETC2: A = P * L * U * Q

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1, N).

  • RHS – [inout]

    RHS is REAL array, dimension (N).

    On entry, the right hand side vector b. On exit, the solution vector X.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N).

    The pivot indices; for 1 <= i <= N, row i of the matrix has been interchanged with row IPIV(i).

  • JPIV – [in]

    JPIV is INTEGER array, dimension (N).

    The pivot indices; for 1 <= j <= N, column j of the matrix has been interchanged with column JPIV(j).

  • SCALE – [out]

    SCALE is REAL

    On exit, SCALE contains the scale factor. SCALE is chosen 0 <= SCALE <= 1 to prevent overflow in the solution.

template<typename T, typename Ta>
void gesc2(integer *n, T *a, integer *lda, T *rhs, integer *ipiv, integer *jpiv, Ta *scale)#

LATDF#

group latdf

Functions

template<typename T>
void latdf(integer *ijob, integer *n, T *z, integer *ldz, T *rhs, T *rdsum, T *rdscal, integer *ipiv, integer *jpiv)#

LATDF uses the LU factorization of the n-by-n matrix computed by sgetc2

and computes a contribution to the reciprocal Dif-estimate.

Purpose:

 LATDF uses the LU factorization of the n-by-n matrix Z computed by
 SGETC2 and computes a contribution to the reciprocal Dif-estimate
 by solving Z * x = b for x, and choosing the r.h.s. b such that
 the norm of x is as large as possible. On entry RHS = b holds the
 contribution from earlier solved sub-systems, and on   return RHS = x.

 The factorization of Z   returned by SGETC2 has the form Z = P*L*U*Q,
 where P and Q are permutation matrices. L is lower triangular with
 unit diagonal elements and U is upper triangular.

Parameters:
  • IJOB – [in]

    IJOB is INTEGER

    IJOB = 2: First compute an approximative null-vector e of Z using SGECON, e is normalized and solve for Zx = +-e - f with the sign giving the greater value of 2-norm(x). About 5 times as expensive as Default.

    IJOB .ne. 2: Local look ahead strategy where all entries of the r.h.s. b is chosen as either +1 or -1 (Default).

  • N – [in]

    N is INTEGER

    The number of columns of the matrix Z.

  • Z – [in]

    Z is REAL array, dimension (LDZ, N)

    On entry, the LU part of the factorization of the n-by-n matrix Z computed by SGETC2: Z = P * L * U * Q

  • LDZ – [in]

    LDZ is INTEGER

    The leading dimension of the array Z. LDA >= fla_max(1, N).

  • RHS – [inout]

    RHS is REAL array, dimension N.

    On entry, RHS contains contributions from other subsystems. On exit, RHS contains the solution of the subsystem with entries according to the value of IJOB (see above).

  • RDSUM – [inout]

    RDSUM is REAL

    On entry, the sum of squares of computed contributions to the Dif-estimate under computation by STGSYL, where the scaling factor RDSCAL (see below) has been factored out.

    On exit, the corresponding sum of squares updated with the contributions from the current sub-system. If TRANS = ‘T’ RDSUM is not touched. NOTE: RDSUM only makes sense when STGSY2 is called by STGSYL.

  • RDSCAL – [inout]

    RDSCAL is REAL

    On entry, scaling factor used to prevent overflow in RDSUM.

    On exit, RDSCAL is updated w.r.t. the current contributions in RDSUM.

    If TRANS = ‘T’, RDSCAL is not touched.

    NOTE: RDSCAL only makes sense when STGSY2 is called by STGSYL.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N).

    The pivot indices; for 1 <= i <= N, row i of the matrix has been interchanged with row IPIV(i).

  • JPIV – [in]

    JPIV is INTEGER array, dimension (N).

    The pivot indices; for 1 <= j <= N, column j of the matrix has been interchanged with column JPIV(j).

template<typename T, typename Ta>
void latdf(integer *ijob, integer *n, T *z, integer *ldz, T *rhs, Ta *rdsum, Ta *rdscal, integer *ipiv, integer *jpiv)#

LA_GERCOND#

group la_gercond

Functions

template<typename T>
T la_gercond(char *trans, integer *n, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, integer *cmode, T *c, integer *info, T *work, integer *iwork)#

LA_GERCOND estimates the Skeel condition number for a general matrix.

Purpose:

 LA_GERCOND estimates the Skeel condition number of op(A) * op2(C)
 where op2 is determined by CMODE as follows
 CMODE =  1    op2(C) = C
 CMODE =  0    op2(C) = I
 CMODE = -1    op2(C) = inv(C)
 The Skeel condition number cond(A) = norminf(|inv(A)||A|)
 is computed by computing scaling factors R such that
 diag(R)*A*op2(C) is row equilibrated and computing the standard
 infinity-norm condition number.

Parameters:
  • TRANS – [in]

    TRANS is 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 – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    On entry, the N-by-N matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AF – [in]

    AF is REAL array, dimension (LDAF,N)

    The factors L and U from the factorization A = P*L*U as computed by SGETRF.

  • LDAF – [in]

    LDAF is INTEGER

    The leading dimension of the array AF. LDAF >= fla_max(1,N).

  • IPIV – [in]

    IPIV is 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 – [in]

    CMODE is 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 – [in]

    C is REAL array, dimension (N)

    The vector C in the formula op(A) * op2(C).

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit.

    i > 0: The ith argument is invalid.

  • WORK – [out]

    WORK is REAL array, dimension (3*N).

    Workspace.

  • IWORK – [out]

    IWORK is INTEGER array, dimension (N).

    Workspace.2

template<typename T, typename Ta>
Ta la_gercond_x(char *trans, integer *n, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, T *x, integer *info, T *work, Ta *rwork)#
template<typename T, typename Ta>
Ta la_gercond_c(char *trans, integer *n, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, Ta *c, logical *capply, integer *info, T *work, Ta *rwork)#

LA_GERPVGRW#

group la_gerpvgrw

Functions

template<typename T>
T la_gerpvgrw(integer *n, integer *ncols, T *a, integer *lda, T *af, integer *ldaf)#

LA_GERPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U)

Purpose:

 LA_GERPVGRW 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.

Parameters:
  • N – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • NCOLS – [in]

    NCOLS is INTEGER

    The number of columns of the matrix A. NCOLS >= 0.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    On entry, the N-by-N matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AF – [in]

    AF is REAL array, dimension (LDAF,N)

    The factors L and U from the factorization A = P*L*U as computed by SGETRF.

  • LDAF – [in]

    LDAF is INTEGER

    The leading dimension of the array AF. LDAF >= fla_max(1,N).

LA_GERFSX_EXTENDED#

group la_gerfsx_extended

Functions

template<typename T>
void la_gerfsx_extended(integer *prec_type, integer *trans_type, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, logical *colequ, T *c, T *b, integer *ldb, T *y, integer *ldy, T *berr_out, integer *n_norms, T *errs_n, T *errs_c, T *res, T *ayb, T *dy, T *y_tail, T *rcond, integer *ithresh, T *rthresh, T *dz_ub, logical *ignore_cwise, integer *info)#

LA_GERFSX_EXTENDED improves the computed solution to a system of

linear equations for general matrices by performing extra-precise iterative

refinement and provides error bounds and backward error estimates

for the solution.

Purpose:

   LA_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 ERRS_N
   and ERRS_C for details of the error bounds. Note that this
   subroutine is only resonsible for setting the second fields of
   ERRS_N and ERRS_C.

Parameters:
  • PREC_TYPE – [in]

    PREC_TYPE is 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’ or ‘E’: Extra

  • TRANS_TYPE – [in]

    TRANS_TYPE is 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 – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right-hand-sides, i.e., the number of columns of the matrix B.

  • A – [in]

    A is REAL array, dimension (LDA,N)

    On entry, the N-by-N matrix A.

  • LDA – [in]

    LDA is INTEGER

    The leading dimension of the array A. LDA >= fla_max(1,N).

  • AF – [in]

    AF is REAL array, dimension (LDAF,N)

    The factors L and U from the factorization A = P*L*U as computed by SGETRF.

  • LDAF – [in]

    LDAF is INTEGER

    The leading dimension of the array AF. LDAF >= fla_max(1,N).

  • IPIV – [in]

    IPIV is 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 – [in]

    COLEQU is 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 – [in]

    C is 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 – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right-hand-side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • Y – [inout]

    Y is REAL array, dimension (LDY,NRHS)

    On entry, the solution matrix X, as computed by SGETRS. On exit, the improved solution matrix Y.

  • LDY – [in]

    LDY is INTEGER

    The leading dimension of the array Y. LDY >= fla_max(1,N).

  • BERR_OUT – [out]

    BERR_OUT is REAL array, dimension (NRHS)

    On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula

    fla_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 – [in]

    N_NORMS is INTEGER

    Determines which error bounds to return (see ERRS_N and ERRS_C).

    If N_NORMS >= 1 return normwise error bounds.

    If N_NORMS >= 2 return componentwise error bounds.

  • ERRS_N – [inout]

    ERRS_N is 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:
    \[ \frac{{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 ERRS_N(i,:) corresponds to the ith right-hand side.

    The second index in ERRS_N(:,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.

  • ERRS_C – [inout]

    ERRS_C is 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:
    \[{max\_j}\ \frac{abs(XTRUE(j,i) - X(j,i))}{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 ERRS_C is not accessed. If N_ERR_BNDS < 3, then at most the first (:,N_ERR_BNDS) entries are returned.

    The first index in ERRS_C(i,:) corresponds to the ith right-hand side.

    The second index in ERRS_C(:,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 – [in]

    RES is REAL array, dimension (N)

    Workspace to hold the intermediate residual.

  • AYB – [in]

    AYB is REAL array, dimension (N)

    Workspace. This can be the same workspace passed for Y_TAIL.

  • DY – [in]

    DY is REAL array, dimension (N)

    Workspace to hold the intermediate solution.

  • Y_TAIL – [in]

    Y_TAIL is REAL array, dimension (N)

    Workspace to hold the trailing bits of the intermediate solution.

  • RCOND – [in]

    RCOND is 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 – [in]

    ITHRESH is 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 ERRS_N and ERRS_C may no longer be trustworthy.

  • RTHRESH – [in]

    RTHRESH is 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 – [in]

    DZ_UB is 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 – [in]

    IGNORE_CWISE is LOGICAL

    If .TRUE. then ignore componentwise convergence. Default value is .FALSE..

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit.

    < 0: if INFO = -i, the ith argument to SGETRS had an illegal value

template<typename T, typename Ta>
void la_gerfsx_extended(integer *prec_type, integer *trans_type, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, integer *ipiv, logical *colequ, Ta *c, T *b, integer *ldb, T *y, integer *ldy, Ta *berr_out, integer *n_norms, Ta *errs_n, Ta *errs_c, T *res, Ta *ayb, T *dy, T *y_tail, Ta *rcond, integer *ithresh, Ta *rthresh, Ta *dz_ub, logical *ignore_cwise, integer *info)#

GBCON#

group gbcon

Functions

template<typename T>
void gbcon(char *norm, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, integer *ipiv, T *anorm, T *rcond, T *work, integer *iwork, integer *info)#

estimates the reciprocal of the condition number of a real general band matrix A, in either the 1-norm or the infinity-norm,

Purpose :

   GBCON estimates the reciprocal of the condition number of a real
   general band matrix A, in either the 1-norm or the infinity-norm,
   using the LU factorization computed by SGBTRF.

   An estimate is obtained for norm(inv(A)), and the reciprocal of the
   condition number is computed as
     RCOND = 1 / ( norm(A) * norm(inv(A))).

Parameters:
  • NORM – [in]

    NORM is CHARACTER*1

    Specifies whether the 1-norm condition number or the infinity-norm condition number is required:

    = ‘1’ or ‘O’: 1-norm;

    = ‘I’: Infinity-norm.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,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.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= N, row i of the matrix was interchanged with row IPIV(i).

  • ANORM – [in]

    ANORM is REAL

    If NORM = ‘1’ or ‘O’, the 1-norm of the original matrix A.

    If NORM = ‘I’, the infinity-norm of the original matrix A.

  • RCOND – [out]

    RCOND is REAL

    The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(norm(A) * norm(inv(A))).

  • WORK – [out] WORK is COMPLEX array, dimension (2*N)

  • RWORK – [out] RWORK is REAL array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gbcon(char *norm, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, integer *ipiv, Ta *anorm, Ta *rcond, T *work, Ta *rwork, integer *info)#

GBTRF#

group gbtrf

Functions

template<typename T>
void gbtrf(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, integer *ipiv, integer *info)#

GBTRF computes the LU factorization of a general band matrix using the pivot

Purpose:

   GBTRF computes an LU factorization of a real m-by-n band matrix A
   using partial pivoting with row interchanges.

   This is the blocked version of the algorithm, calling Level 3 BLAS.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [inout]

    AB is REAL array, dimension (LDAB,N)

    On entry, the matrix A in band storage, in rows KL+1 to 2*KL+KU+1; rows 1 to KL of the array need not be set. The j-th column of A is stored in the j-th column of the array AB as follows:

    AB(kl+ku+1+i-j,j) = A(i,j) for fla_max(1,j-ku)<=i<=min(m,j+kl)

    On exit, details of the factorization: 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. See below for further details.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (min(M,N))

    The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = +i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GBTF2#

group gbtf2

Functions

template<typename T>
void gbtf2(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, integer *ipiv, integer *info)#

GBTF2 computes the LU factorization of a general band matrix using the unblocked version of the algorithm.

Purpose:

   GBTF2 computes an LU factorization of a real m-by-n band matrix A
   using partial pivoting with row interchanges.

   This is the unblocked version of the algorithm, calling Level 2 BLAS.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [inout]

    AB is REAL array, dimension (LDAB,N)

    On entry, the matrix A in band storage, in rows KL+1 to 2*KL+KU+1; rows 1 to KL of the array need not be set. The j-th column of A is stored in the j-th column of the array AB as follows:

    AB(kl+ku+1+i-j,j) = A(i,j) for fla_max(1,j-ku)<=i<=min(m,j+kl)

    On exit, details of the factorization: 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. See below for further details.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

  • IPIV – [out]

    IPIV is INTEGER array, dimension (min(M,N))

    The pivot indices; for 1 <= i <= min(M,N), row i of the matrix was interchanged with row IPIV(i).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = +i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GBTRS#

group gbtrs

Functions

template<typename T>
void gbtrs(char *trans, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, integer *ipiv, T *b, integer *ldb, integer *info)#

GBTRS solves a system of linear equationsA * X = B or A**T * X = B with a general band matrix A using the LU factorization computed by GBTRF

Purpose:

    GBTRS solves a system of linear equations
    A * X = B  or  A**T * X = B
    with a general band matrix A using the LU factorization computed
    by GBTRF.

Parameters:
  • TRANS – [in]

    TRANS is CHARACTER*1

    Specifies the form of the system of equations.

    = ‘N’: A * X = B (No transpose)

    = ‘T’: A**T* X = B (Transpose)

    = ‘C’: A**T* X = B (Conjugate transpose = Transpose)

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,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.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= 2*KL+KU+1.

  • IPIV – [in]

    IPIV is INTEGER

    array, dimension (N) The pivot indices; for 1 <= i <= N, row i of the matrix was interchanged with row IPIV(i).

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the right hand side matrix B. On exit, the solution matrix X.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GBRFS#

group gbrfs

Functions

template<typename T>
void gbrfs(char *trans, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, T *ferr, T *berr, T *work, integer *iwork, integer *info)#

Improves computed solution to banded matrix and provides error bounds and backward estimates.

Purpose:

    GBRFS improves the computed solution to a system of linear
    equations when the coefficient matrix is banded, and provides
    error bounds and backward error estimates for the solution.

Parameters:
  • TRANS – [in]

    TRANS is 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 – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns

    of the matrices B and X. NRHS >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The original band matrix A, stored 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 fla_max(1,j-ku)<=i<=min(n,j+kl).

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • AFB – [in]

    AFB is 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 – [in]

    LDAFB is INTEGER

    The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices from SGBTRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • B – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right hand side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • X – [inout]

    X is REAL array, dimension (LDX,NRHS)

    On entry, the solution matrix X, as computed by SGBTRS. On exit, the improved solution matrix X.

  • LDX – [in]

    LDX is INTEGER

    The leading dimension of the array X. LDX >= fla_max(1,N).

  • FERR – [out]

    FERR is REAL array, dimension (NRHS)

    The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X).

    If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

  • BERR – [out]

    BERR is REAL array, dimension (NRHS)

    The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

  • WORK – [out] WORK is COMPLEX array, dimension (2*N)

  • RWORK – [out] RWORK is REAL array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gbrfs(char *trans, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#

GBRFSX#

group gbrfsx

Functions

template<typename T>
void gbrfsx(char *trans, char *equed, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, T *r, T *c, T *b, integer *ldb, T *x, integer *ldx, T *rcond, T *berr, integer *n_err_bnds, T *err_bnds_norm, T *err_bnds_comp, integer *nparams, T *params, T *work, integer *iwork, integer *info)#

Improves computed solution to banded matrix and provides backward estimates,component wise and normwise error bound.

@details
\b Purpose:
\verbatim
Improves computed solution to banded matrix and provides backward estimates,component wise and
normwise error bounds

Parameters:
  • TRANS – [in]

    TRANS is 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)

  • EQUED – [in]

    EQUED is CHARACTER*1

    Specifies the form of equilibration that was done to A before calling this routine. This is needed to compute the solution and error bounds correctly.

    = ‘N’: No equilibration

    = ‘R’: Row equilibration, i.e., A has been premultiplied by diag(R).

    = ‘C’: Column equilibration, i.e., A has been postmultiplied by diag(C).

    = ‘B’: Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C). The right hand side B has been changed accordingly.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrices B and X. NRHS >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The original band matrix A, stored 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 fla_max(1,j-ku)<=i<=min(n,j+kl).

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • AFB – [in]

    AFB is REAL 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 – [in]

    LDAFB is INTEGER

    The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.

  • IPIV – [in]

    IPIV is INTEGER

    array, dimension (N)

    The pivot indices from SGETRF; for 1<=i<=N, row i of the matrix was interchanged with row IPIV(i).

  • R – [inout]

    R is REAL array, dimension (N)

    The row scale factors for A. If EQUED = ‘R’ or ‘B’, A is multiplied on the left by diag(R); if EQUED = ‘N’ or ‘C’, R is not accessed. R is an input argument if FACT = ‘F’; otherwise, R is an output argument. If FACT = ‘F’ and EQUED = ‘R’ or ‘B’, each element of R must be positive.

    If R is output, each element of R is a power of the radix. If R is input, each element of R 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.

  • C – [inout]

    C is REAL array, dimension (N)

    The column scale factors for A. If EQUED = ‘C’ or ‘B’, A is multiplied on the right by diag(C); if EQUED = ‘N’ or ‘R’, C is not accessed. C is an input argument if FACT = ‘F’; otherwise, C is an output argument. If FACT = ‘F’ and EQUED = ‘C’ or ‘B’, each element of C must be positive.

    If C is output, each element of C is a power of the radix.

    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 – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right hand side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • X – [inout]

    X is REAL array, dimension (LDX,NRHS)

    On entry, the solution matrix X, as computed by SGETRS.

    On exit, the improved solution matrix X.

  • LDX – [in]

    LDX is INTEGER

    The leading dimension of the array X. LDX >= fla_max(1,N).

  • RCOND – [out]

    RCOND is 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.

  • BERR – [out]

    BERR is REAL array, dimension (NRHS)

    Componentwise relative backward error. This is the componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

  • N_ERR_BNDS – [in]

    N_ERR_BNDS is INTEGER

    Number of error bounds to return for each right hand side and each type (normwise or componentwise). See ERR_BNDS_NORM and ERR_BNDS_COMP below.

  • ERR_BNDS_NORM – [out]

    ERR_BNDS_NORM is 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:
    \[ \frac{{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.

  • ERR_BNDS_COMP – [out]

    ERR_BNDS_COMP is 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:
    \[{max\_j} \frac{abs(XTRUE(j,i) - X(j,i))}{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 < 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.

    See Lapack Working Note 165 for further details and extra cautions.

  • NPARAMS – [in]

    NPARAMS is INTEGER

    Specifies the number of parameters set in PARAMS. If <= 0, the PARAMS array is never referenced and default values are used.

  • PARAMS – [inout]

    PARAMS is REAL array, dimension NPARAMS

    Specifies algorithm parameters. If an entry is < 0.0, then that entry will be filled with default value used for that parameter. Only positions up to NPARAMS are accessed; defaults are used for higher-numbered parameters.

    PARAMS(LA_LINRX_ITREF_I = 1) : Whether to perform iterative refinement or not.

    Default: 1.0

    = 0.0: No refinement is performed, and no error bounds are computed.

    = 1.0: Use the double-precision refinement algorithm, possibly with doubled-single computations if the compilation environment does not support DOUBLE PRECISION.

    (other values are reserved for future use)

    PARAMS(LA_LINRX_ITHRESH_I = 2) : Maximum number of residual computations allowed for refinement.

    Default: 10

    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.

    PARAMS(LA_LINRX_CWISE_I = 3) : Flag determining if the code will attempt to find a solution with small componentwise relative error in the double-precision algorithm. Positive is true, 0.0 is false.

    Default: 1.0 (attempt componentwise convergence)

  • WORK – [out] WORK is COMPLEX array, dimension (2*N)

  • RWORK – [out] RWORK is REAL array, dimension (2*N)

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit. The solution to every right-hand side is guaranteed.

    < 0: If INFO = -i, the i-th argument had an illegal value

    > 0 and <= N: U(INFO,INFO) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution and error bounds could not be computed. RCOND = 0 is returned.

    = N+J: The solution corresponding to the Jth right-hand side is not guaranteed. The solutions corresponding to other right- hand sides K with K > J may not be guaranteed as well, but only the first such right-hand side is reported. If a small componentwise error is not requested (PARAMS(3) = 0.0) then the Jth right-hand side is the first with a normwise error bound that is not guaranteed (the smallest J such that ERR_BNDS_NORM(J,1) = 0.0). By default (PARAMS(3) = 1.0) the Jth right-hand side is the first with either a normwise or componentwise error bound that is not guaranteed (the smallest J such that either ERR_BNDS_NORM(J,1) = 0.0 or ERR_BNDS_COMP(J,1) = 0.0). See the definition of ERR_BNDS_NORM(:,1) and ERR_BNDS_COMP(:,1). To get information about all of the right-hand sides check ERR_BNDS_NORM or ERR_BNDS_COMP.

template<typename T, typename Ta>
void gbrfsx(char *trans, char *equed, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, Ta *r, Ta *c, T *b, integer *ldb, T *x, integer *ldx, Ta *rcond, Ta *berr, integer *n_err_bnds, Ta *err_bnds_norm, Ta *err_bnds_comp, integer *nparams, Ta *params, T *work, Ta *rwork, integer *info)#

GBEQU#

group gbequ

Functions

template<typename T>
void gbequ(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, T *r, T *c, T *rowcnd, T *colcnd, T *amax, integer *info)#

Computes row and column scalings intended to equilibrate band matrix and reduce its condition number.

Purpose:

   GBEQU computes row and column scalings intended to equilibrate an
   M-by-N band matrix A and reduce its condition number.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The band matrix A, stored 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 fla_max(1,j-ku)<=i<=min(m,j+kl).

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • R – [out]

    R is REAL array, dimension (M)

    If INFO = 0, or INFO > M, R contains the row scale factors for A.

  • C – [out]

    C is REAL array, dimension (N)

    If INFO = 0, C contains the column scale factors for A.

  • ROWCND – [out]

    ROWCND is REAL

    If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

  • COLCND – [out]

    COLCND is REAL

    If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

  • AMAX – [out]

    AMAX is REAL

    Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, and i is

    <= M: the i-th row of A is exactly zero

    > M: the (i-M)-th column of A is exactly zero

template<typename T, typename Ta>
void gbequ(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, integer *info)#

GBEQUB#

group gbequb

Functions

template<typename T>
void gbequb(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, T *r, T *c, T *rowcnd, T *colcnd, T *amax, integer *info)#

Computes row and column scalings intended to equilibrate band matrix and reduce its condition number(scaling factor:power of radix)

Purpose:

   GBEQUB computes row and column scalings intended to equilibrate an
   M-by-N matrix A and reduce its condition number.  R returns the row
   scale factors and C the column scale factors, chosen to try to make
   the largest element in each row and column of the matrix B with
   elements B(i,j)=R(i)*A(i,j)*C(j) have an absolute value of at most
   the radix.

   R(i) and C(j) are restricted to be a power of the radix between
   SMLNUM = smallest safe number and BIGNUM = largest safe number.  Use
   of these scaling factors is not guaranteed to reduce the condition
   number of A but works well in practice.

   This routine differs from SGEEQU by restricting the scaling factors
   to a power of the radix.  Barring over- and underflow, scaling by
   these factors introduces no additional rounding errors.  However, the
   scaled entries' magnitudes are no longer approximately 1 but lie
   between sqrt(radix) and 1/sqrt(radix).

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The band matrix A, stored 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 fla_max(1,j-ku)<=i<=min(m,j+kl).

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • R – [out]

    R is REAL array, dimension (M)

    If INFO = 0, or INFO > M, R contains the row scale factors for A.

  • C – [out]

    C is REAL array, dimension (N)

    If INFO = 0, C contains the column scale factors for A.

  • ROWCND – [out]

    ROWCND is REAL

    If INFO = 0 or INFO > M, ROWCND contains the ratio of the smallest R(i) to the largest R(i). If ROWCND >= 0.1 and AMAX is neither too large nor too small, it is not worth scaling by R.

  • COLCND – [out]

    COLCND is REAL

    If INFO = 0, COLCND contains the ratio of the smallest C(i) to the largest C(i). If COLCND >= 0.1, it is not worth scaling by C.

  • AMAX – [out]

    AMAX is REAL

    Absolute value of largest matrix element. If AMAX is very close to overflow or very close to underflow, the matrix should be scaled.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

    > 0: if INFO = i, and i is

    <= M: the i-th row of A is exactly zero

    > M: the (i-M)-th column of A is exactly zero

template<typename T, typename Ta>
void gbequb(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, integer *info)#

LAQGB#

group laqgb

Functions

template<typename T>
void laqgb(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, T *r, T *c, T *rowcnd, T *colcnd, T *amax, char *equed)#

LAQGB scales a general band matrix, using row and column scaling factors computed by gbequ.

Purpose:

   LAQGB equilibrates a general M by N band matrix A with KL
   subdiagonals and KU superdiagonals using the row and scaling factors
   in the vectors R and C.

Parameters:
  • M – [in]

    M is INTEGER

    The number of rows of the matrix A. M >= 0.

  • N – [in]

    N is INTEGER

    The number of columns of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [inout]

    AB is 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 fla_max(1,j-ku)<=i<=min(m,j+kl)

    On exit, the equilibrated matrix, in the same storage format as A. See EQUED for the form of the equilibrated matrix.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDA >= KL+KU+1.

  • R – [in]

    R is REAL array, dimension (M)

    The row scale factors for A.

  • C – [in]

    C is REAL array, dimension (N)

    The column scale factors for A.

  • ROWCND – [in]

    ROWCND is REAL

    Ratio of the smallest R(i) to the largest R(i).

  • COLCND – [in]

    COLCND is REAL

    Ratio of the smallest C(i) to the largest C(i).

  • AMAX – [in]

    AMAX is REAL

    Absolute value of largest matrix entry.

  • EQUED – [out]

    EQUED is CHARACTER*1

    Specifies the form of equilibration that was done.

    = ‘N’: No equilibration

    = ‘R’: Row equilibration, i.e., A has been premultiplied by diag(R).

    = ‘C’: Column equilibration, i.e., A has been postmultiplied by diag(C).

    = ‘B’: Both row and column equilibration, i.e., A has been replaced by diag(R) * A * diag(C).

template<typename T, typename Ta>
void laqgb(integer *m, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, Ta *r, Ta *c, Ta *rowcnd, Ta *colcnd, Ta *amax, char *equed)#

GBRCOND#

group gbrcond

Functions

template<typename T>
T la_gbrcond(char *trans, integer *n, integer *kl, integer *ku, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, integer *cmode, T *c, integer *info, T *work, integer *iwork)#

LA_GBRCOND estimates the Skeel condition number for a general banded matrix.

Purpose:

 LA_GBRCOND Estimates the Skeel condition number of  op(A) * op2(C)
 where op2 is determined by CMODE as follows
 CMODE =  1    op2(C) = C
 CMODE =  0    op2(C) = I
 CMODE = -1    op2(C) = inv(C)
 The Skeel condition number  cond(A) = norminf(|inv(A)||A|)
 is computed by computing scaling factors R such that
 diag(R)*A*op2(C) is row equilibrated and computing the standard
 infinity-norm condition number.

Parameters:
  • TRANS – [in]

    TRANS is 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 – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • AB – [in]

    AB is 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 fla_max(1,j-KU)<=i<=min(N,j+kl)

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • AFB – [in]

    AFB is 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 – [in]

    LDAFB is INTEGER

    The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.

  • IPIV – [in]

    IPIV is 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 – [in]

    CMODE is 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 – [in]

    C is REAL array, dimension (N)

    The vector C in the formula op(A) * op2(C).

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit.

    i > 0: The ith argument is invalid.

  • WORK – [out]

    WORK is REAL array, dimension (5*N).

    Workspace.

  • IWORK – [out]

    IWORK is INTEGER array, dimension (N).

    Workspace.

LA_GBRPVGRW#

group la_gbrpvgrw

Functions

template<typename T>
T la_gbrpvgrw(integer *n, integer *kl, integer *ku, integer *ncols, T *ab, integer *ldab, T *afb, integer *ldafb)#

LA_GBRPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a general banded matrix.

Purpose:

   LA_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.

Parameters:
  • N – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0.

  • NCOLS – [in]

    NCOLS is INTEGER

    The number of columns of the matrix A. NCOLS >= 0.

  • AB – [in]

    AB is 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 fla_max(1,j-KU)<=i<=min(N,j+kl)

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= KL+KU+1.

  • AFB – [in]

    AFB is 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 – [in]

    LDAFB is INTEGER

    The leading dimension of the array AFB. LDAFB >= 2*KL+KU+1.

template<typename T, typename Ta>
Ta la_gbrpvgrw(integer *n, integer *kl, integer *ku, integer *ncols, T *ab, integer *ldab, T *afb, integer *ldafb)#

LA_GBRFSX_EXTENDED#

group la_gbrfsx_extended

Functions

template<typename T>
void la_gbrfsx_extended(integer *prec_type, integer *trans_type, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, logical *colequ, T *c, T *b, integer *ldb, T *y, integer *ldy, T *berr_out, integer *n_norms, T *err_bnds_norm, T *err_bnds_comp, T *res, T *ayb, T *dy, T *y_tail, T *rcond, integer *ithresh, T *rthresh, T *dz_ub, logical *ignore_cwise, integer *info)#

LA_GBRFSX_EXTENDED improves the computed solution to a system of

linear equations for general banded matrices by performing extra-precise

iterative refinement and provides error bounds and backward error

estimates for the solution.

Purpose:

   LA_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.

Parameters:
  • PREC_TYPE – [in]

    PREC_TYPE is 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’ or ‘E’: Extra

  • TRANS_TYPE – [in]

    TRANS_TYPE is 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 – [in]

    N is INTEGER

    The number of linear equations, i.e., the order of the matrix A. N >= 0.

  • KL – [in]

    KL is INTEGER

    The number of subdiagonals within the band of A. KL >= 0.

  • KU – [in]

    KU is INTEGER

    The number of superdiagonals within the band of A. KU >= 0

  • NRHS – [in]

    NRHS is INTEGER

    The number of right-hand-sides, i.e., the number of columns of the matrix B.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    On entry, the N-by-N matrix AB.

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array AB. LDAB >= fla_max(1,N).

  • AFB – [in]

    AFB is REAL array, dimension (LDAFB,N)

    The factors L and U from the factorization A = P*L*U as computed by SGBTRF.

  • LDAFB – [in]

    LDAFB is INTEGER

    The leading dimension of the array AF. LDAFB >= fla_max(1,N).

  • IPIV – [in]

    IPIV is 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 – [in]

    COLEQU is 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 – [in]

    C is 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 – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right-hand-side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • Y – [inout]

    Y is REAL array, dimension (LDY,NRHS)

    On entry, the solution matrix X, as computed by SGBTRS. On exit, the improved solution matrix Y.

  • LDY – [in]

    LDY is INTEGER

    The leading dimension of the array Y. LDY >= fla_max(1,N).

  • BERR_OUT – [out]

    BERR_OUT is REAL array, dimension (NRHS)

    On exit, BERR_OUT(j) contains the componentwise relative backward error for right-hand-side j from the formula

    fla_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 – [in]

    N_NORMS is 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 – [inout]

    ERR_BNDS_NORM is 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:
    \[ \frac{{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 – [inout]

    ERR_BNDS_COMP is 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:
    \[{max\_j}\ \frac{abs(XTRUE(j,i) - X(j,i))}{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 < 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 – [in]

    RES is REAL array, dimension (N)

    Workspace to hold the intermediate residual.

  • AYB – [in]

    AYB is REAL array, dimension (N)

    Workspace. This can be the same workspace passed for Y_TAIL.

  • DY – [in]

    DY is REAL array, dimension (N)

    Workspace to hold the intermediate solution.

  • Y_TAIL – [in]

    Y_TAIL is REAL array, dimension (N)

    Workspace to hold the trailing bits of the intermediate solution.

  • RCOND – [in]

    RCOND is 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 – [in]

    ITHRESH is 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 – [in]

    RTHRESH is 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 – [in]

    DZ_UB is 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 – [in]

    IGNORE_CWISE is LOGICAL

    If .TRUE. then ignore componentwise convergence. Default value is .FALSE..

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit.

    < 0: if INFO = -i, the ith argument to SGBTRS had an illegal value

template<typename T, typename Ta>
void la_gbrfsx_extended(integer *prec_type, integer *trans_type, integer *n, integer *kl, integer *ku, integer *nrhs, T *ab, integer *ldab, T *afb, integer *ldafb, integer *ipiv, logical *colequ, Ta *c, T *b, integer *ldb, T *y, integer *ldy, Ta *berr_out, integer *n_norms, Ta *err_bnds_norm, Ta *err_bnds_comp, T *res, Ta *ayb, T *dy, T *y_tail, Ta *rcond, integer *ithresh, Ta *rthresh, Ta *dz_ub, logical *ignore_cwise, integer *info)#

GTCON#

group gtcon

Functions

template<typename T>
void gtcon(char *norm, integer *n, T *dl, T *d, T *du, T *du2, integer *ipiv, T *anorm, T *rcond, T *work, integer *iwork, integer *info)#

GTCON estimates the reciprocal of the condition number of a real tridiagonal matrix A.

Purpose:

  GTCON estimates the reciprocal of the condition number of a real
  tridiagonal matrix A using the LU factorization as computed by
  SGTTRF.

  An estimate is obtained for norm(inv(A)), and the reciprocal of the
  condition number is computed as RCOND = 1 / (ANORM * norm(inv(A))).

Parameters:
  • NORM – [in]

    NORM is CHARACTER*1

    Specifies whether the 1-norm condition number or the infinity-norm condition number is required:

    = ‘1’ or ‘O’: 1-norm;

    = ‘I’: Infinity-norm.

  • N – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • DL – [in]

    DL is REAL array, dimension (N-1)

    The (n-1) multipliers that define the matrix L from the LU factorization of A as computed by SGTTRF.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  • DU – [in]

    DU is REAL array, dimension (N-1)

    The (n-1) elements of the first superdiagonal of U.

  • DU2 – [in]

    DU2 is REAL array, dimension (N-2)

    The (n-2) elements of the second superdiagonal of U.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

  • ANORM – [in]

    ANORM is REAL

    If NORM = ‘1’ or ‘O’, the 1-norm of the original matrix A.

    If NORM = ‘I’, the infinity-norm of the original matrix A.

  • RCOND – [out]

    RCOND is REAL

    The reciprocal of the condition number of the matrix A, computed as RCOND = 1/(ANORM * AINVNM), where AINVNM is an estimate of the 1-norm of inv(A) computed in this routine.

  • WORK – [out] WORK is REAL array, dimension (2*N)

  • IWORK – [out] IWORK is INTEGER array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gtcon(char *norm, integer *n, T *dl, T *d, T *du, T *du2, integer *ipiv, Ta *anorm, Ta *rcond, T *work, integer *info)#

GTTRF#

group gttrf

Functions

template<typename T>
void gttrf(integer *n, T *dl, T *d, T *du, T *du2, integer *ipiv, integer *info)#

GTTRF computes an LU factorization of a real tridiagonal matrix A.

Purpose:

    GTTRF computes an LU factorization of a real tridiagonal matrix A
    using elimination with partial pivoting and row interchanges.
    The factorization has the form
       A = L * U
    where L is a product of permutation and unit lower bidiagonal
    matrices and U is upper triangular with nonzeros in only the main
    diagonal and first two superdiagonals.

Parameters:
  • N – [in]

    N is INTEGER

    The order of the matrix A.

  • DL – [inout]

    DL is REAL array, dimension (N-1)

    On entry, DL must contain the (n-1) sub-diagonal elements of A.

    On exit, DL is overwritten by the (n-1) multipliers that define the matrix L from the LU factorization of A.

  • D – [inout]

    D is REAL array, dimension (N)

    On entry, D must contain the diagonal elements of A.

    On exit, D is overwritten by the n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  • DU – [inout]

    DU is REAL array, dimension (N-1)

    On entry, DU must contain the (n-1) super-diagonal elements of A.

    On exit, DU is overwritten by the (n-1) elements of the first super-diagonal of U.

  • DU2 – [out]

    DU2 is REAL array, dimension (N-2)

    On exit, DU2 is overwritten by the (n-2) elements of the second super-diagonal of U.

  • IPIV – [out]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -k, the k-th argument had an illegal value

    > 0: if INFO = k, U(k,k) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

GTTRS#

group gttrs

Functions

template<typename T>
void gttrs(char *trans, integer *n, integer *nrhs, T *dl, T *d, T *du, T *du2, integer *ipiv, T *b, integer *ldb, integer *info)#

GTTRS solves one of the systems of equations.

Purpose:

  GTTRS solves one of the systems of equations
     A*X = B  or  A**T*X = B,
  with a tridiagonal matrix A using the LU factorization computed
  by SGTTRF.

Parameters:
  • TRANS – [in]

    TRANS is CHARACTER*1

    Specifies the form of the system of equations.

    = ‘N’: A * X = B (No transpose)

    = ‘T’: A**T* X = B (Transpose)

    = ‘C’: A**T* X = B (Conjugate transpose = Transpose)

  • N – [in]

    N is INTEGER

    The order of the matrix A.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  • DL – [in]

    DL is REAL array, dimension (N-1)

    The (n-1) multipliers that define the matrix L from the LU factorization of A.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  • DU – [in]

    DU is REAL array, dimension (N-1)

    The (n-1) elements of the first super-diagonal of U.

  • DU2 – [in]

    DU2 is REAL array, dimension (N-2)

    The (n-2) elements of the second super-diagonal of U.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the matrix of right hand side vectors B.

    On exit, B is overwritten by the solution vectors X.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

GTTS2#

group gtts2

Functions

template<typename T>
void gtts2(integer *itrans, integer *n, integer *nrhs, T *dl, T *d, T *du, T *du2, integer *ipiv, T *b, integer *ldb)#

GTTS2 solves a system of linear equations with a tridiagonal matrix using the LU factorization computed by sgttrf.

Purpose:

   GTTS2 solves one of the systems of equations
      A*X = B  or  A**T*X = B,
   with a tridiagonal matrix A using the LU factorization computed
   by GTTRF.

Parameters:
  • ITRANS – [in]

    ITRANS is INTEGER

    Specifies the form of the system of equations.

    = 0: A * X = B (No transpose)

    = 1: A**T* X = B (Transpose)

    = 2: A**T* X = B (Conjugate transpose = Transpose)

  • N – [in]

    N is INTEGER

    The order of the matrix A.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  • DL – [in]

    DL is REAL array, dimension (N-1)

    The (n-1) multipliers that define the matrix L from the LU factorization of A.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  • DU – [in]

    DU is REAL array, dimension (N-1)

    The (n-1) elements of the first super-diagonal of U.

  • DU2 – [in]

    DU2 is REAL array, dimension (N-2)

    The (n-2) elements of the second super-diagonal of U.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the matrix of right hand side vectors B. On exit, B is overwritten by the solution vectors X.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

GTRFS#

group gtrfs

Functions

template<typename T>
void gtrfs(char *trans, integer *n, integer *nrhs, T *dl, T *d, T *du, T *dlf, T *df, T *duf, T *du2, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, T *ferr, T *berr, T *work, T *iwork, integer *info)#

GTRFS improves the computed solution to a system of linear equations.

Purpose:

  GTRFS improves the computed solution to a system of linear
  equations when the coefficient matrix is tridiagonal, and provides
  error bounds and backward error estimates for the solution.

Parameters:
  • TRANS – [in]

    TRANS is 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 – [in]

    N is INTEGER

    The order of the matrix A. N >= 0.

  • NRHS – [in]

    NRHS is INTEGER

    The number of right hand sides, i.e., the number of columns of the matrix B. NRHS >= 0.

  • DL – [in]

    DL is REAL array, dimension (N-1)

    The (n-1) subdiagonal elements of A.

  • D – [in]

    D is REAL array, dimension (N)

    The diagonal elements of A.

  • DU – [in]

    DU is REAL array, dimension (N-1)

    The (n-1) superdiagonal elements of A.

  • DLF – [in]

    DLF is REAL array, dimension (N-1)

    The (n-1) multipliers that define the matrix L from the LU factorization of A as computed by SGTTRF.

  • DF – [in]

    DF is REAL array, dimension (N)

    The n diagonal elements of the upper triangular matrix U from the LU factorization of A.

  • DUF – [in]

    DUF is REAL array, dimension (N-1)

    The (n-1) elements of the first superdiagonal of U.

  • DU2 – [in]

    DU2 is REAL array, dimension (N-2)

    The (n-2) elements of the second superdiagonal of U.

  • IPIV – [in]

    IPIV is INTEGER array, dimension (N)

    The pivot indices; for 1 <= i <= n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.

  • B – [in]

    B is REAL array, dimension (LDB,NRHS)

    The right hand side matrix B.

  • LDB – [in]

    LDB is INTEGER

    The leading dimension of the array B. LDB >= fla_max(1,N).

  • X – [inout]

    X is REAL array, dimension (LDX,NRHS)

    On entry, the solution matrix X, as computed by SGTTRS. On exit, the improved solution matrix X.

  • LDX – [in]

    LDX is INTEGER

    The leading dimension of the array X. LDX >= fla_max(1,N).

  • FERR – [out]

    FERR is REAL array, dimension (NRHS)

    The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), FERR(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for RCOND, and is almost always a slight overestimate of the true error.

  • BERR – [out]

    BERR is REAL array, dimension (NRHS)

    The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution).

  • WORK – [out] WORK is REAL array, dimension (3*N)

  • IWORK – [out] IWORK is INTEGER array, dimension (N)

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

    < 0: if INFO = -i, the i-th argument had an illegal value

template<typename T, typename Ta>
void gtrfs(char *trans, integer *n, integer *nrhs, T *dl, T *d, T *du, T *dlf, T *df, T *duf, T *du2, integer *ipiv, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#