Cholesky Factorization APIs#

POTRF#

group potrf

Functions

template<typename T>
void potrf(char *uplo, integer *n, T *a, integer *lda, integer *info)#

Cholesky factorization of a real symmetric positive definite matrix a.

Purpose:

    Cholesky factorization of a real symmetric positive definite matrix a.
    The factorization has the form
        A = U**T * U,  if uplo = 'U', or
        A = L * L**T,  if uplo = 'L',
    where U is an upper triangular matrix and L is lower triangular.

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

Parameters:
  • uplo – [in]

    uplo is char*.

    uplo specifies output format

    = ‘U’: Output is upper triangular factorization of A

    = ‘L’: Output is lower triangular factorization of A

  • n – [in]

    n is int*.

    The order of the matrix a. n >= 0

  • a – [inout]

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

    On entry, the symmetric matrix a. If uplo = ‘U’, the leading n-by-n upper triangular part of a contains the upper triangular part of the matrix a, and the strictly lower triangular part of a is not referenced. If uplo = ‘L’, the leading n-by-n lower triangular part of a contains the lower triangular part of the matrix a, and the strictly upper triangular part of a is not referenced.

    On exit, if info = 0, the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.

  • lda – [in]

    lda is int*.

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

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

POTRF2#

group potrf2

Functions

template<typename T>
void potrf2(char *uplo, integer *n, T *a, integer *lda, integer *info)#

POTRF2 computes the Cholesky factorization of a real symmetric

positive definite matrix A using the recursive algorithm.

Purpose:

   POTRF2 computes the Cholesky factorization of a real symmetric
   positive definite matrix A using the recursive algorithm.

   The factorization has the form
      A = U**T * U,  if UPLO = 'U', or
      A = L  * L**T,  if UPLO = 'L',
   where U is an upper triangular matrix and L is lower triangular.

   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 = n/2
          [  A21 | A22  ]       n2 = n-n1

   The subroutine calls itself to factor A11. Update and scale A21
   or A12, update A22 then call itself to factor A22.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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 symmetric matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

    On exit, if INFO = 0, the factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T.

  • LDA – [in]

    LDA is INTEGER

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

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

POTF2#

group potf2

Functions

template<typename T>
void potf2(char *uplo, integer *n, T *a, integer *lda, integer *info)#

Cholesky factorization of a real symmetric positive definite matrix a.

Purpose:

    Cholesky factorization of a real symmetric positive definite matrix a
    The factorization has the form
        A = U**T * U,  if uplo = 'U', or
        A = L * L**T,  if uplo = 'L',
    where U is an upper triangular matrix and L is lower triangular.

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

Parameters:
  • uplo – [in]

    uplo is char*

    uplo specifies output format

    = ‘U’: Output is upper triangular factorization of A

    = ‘L’: Output is lower triangular factorization of A

  • n – [in]

    n is integer*

    The order of the matrix a. n >= 0

  • a – [inout]

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

    On entry, the symmetric matrix a. If uplo = ‘U’, the leading n-by-n upper triangular part of a contains the upper triangular part of the matrix a, and the strictly lower triangular part of a is not referenced. If uplo = ‘L’, the leading n-by-n lower triangular part of a contains the lower triangular part of the matrix a, and the strictly upper triangular part of a is not referenced.

    On exit, if info = 0, the factor U or L from the Cholesky factorization A = U**T *U or A = L*L**T.

  • lda – [in]

    lda is integer*

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

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = k, the leading minor of order k is not positive definite, and the factorization could not be completed.

PSTRF#

group pstrf

Functions

template<typename T>
void pstrf(char *uplo, integer *n, T *a, integer *lda, integer *piv, integer *rank, T *tol, T *work, integer *info)#

PSTRF computes the Cholesky factorization with complete pivoting of a real symmetric positive semidefinite matrix.

Purpose:

    PSTRF computes the Cholesky factorization with complete
    pivoting of a real symmetric positive semidefinite matrix A.

    The factorization has the form
       P**T * A * P = U**T * U ,  if UPLO = 'U',
       P**T * A * P = L  * L**T,  if UPLO = 'L',
    where U is an upper triangular matrix and L is lower triangular, and
    P is stored as vector PIV.

    This algorithm does not attempt to check that A is positive
    semidefinite. This version of the algorithm calls level 3 BLAS.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies whether the upper or lower triangular part of the symmetric matrix A is stored.

    = ‘U’: Upper triangular

    = ‘L’: Lower triangular

  • 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 symmetric matrix A. If UPLO = ‘U’, the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

    On exit, if INFO = 0, the factor U or L from the Cholesky factorization as above.

  • LDA – [in]

    LDA is INTEGER

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

  • PIV – [out]

    PIV is INTEGER array, dimension (N)

    PIV is such that the nonzero entries are P( PIV(K), K) = 1.

  • RANK – [out]

    RANK is INTEGER

    The rank of A given by the number of steps the algorithm completed.

  • TOL – [in]

    TOL is REAL

    User defined tolerance. If TOL < 0, then N*U*MAX( A(K,K)) will be used. The algorithm terminates at the (K-1)st step if the pivot <= TOL.

  • WORK – [out]

    WORK is REAL array, dimension (2*N)

    Work space.

  • INFO – [out]

    INFO is INTEGER

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

    = 0: algorithm completed successfully, and

    > 0: the matrix A is either rank deficient with computed rank as returned in RANK, or is not positive semidefinite. See Section 7 of LAPACK Working Note #161 for further information.

template<typename T, typename Ta>
void pstrf(char *uplo, integer *n, T *a, integer *lda, integer *piv, integer *rank, Ta *tol, Ta *work, integer *info)#

PSTF2#

group pstf2

Functions

template<typename T>
void pstf2(char *uplo, integer *n, T *a, integer *lda, integer *piv, integer *rank, T *tol, T *work, integer *info)#

PSTF2 computes the Cholesky factorization with complete pivoting

of a real symmetric positive semidefinite matrix.

Purpose:

   PSTF2 computes the Cholesky factorization with complete
   pivoting of a real symmetric positive semidefinite matrix A.

   The factorization has the form
      P**T * A * P = U**T * U , if UPLO = 'U',
      P**T * A * P = L  * L**T, if UPLO = 'L',
   where U is an upper triangular matrix and L is lower triangular, and
   P is stored as vector PIV.

   This algorithm does not attempt to check that A is positive
   semidefinite. This version of the algorithm calls level 2 BLAS.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies whether the upper or lower triangular part of the symmetric matrix A is stored.

    = ‘U’: Upper triangular

    = ‘L’: Lower triangular

  • 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 symmetric matrix A. If UPLO = ‘U’, the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

    On exit, if INFO = 0, the factor U or L from the Cholesky factorization as above.

  • PIV – [out]

    PIV is INTEGER array, dimension (N)

    PIV is such that the nonzero entries are P(PIV(K), K) = 1.

  • RANK – [out]

    RANK is INTEGER

    The rank of A given by the number of steps the algorithm completed.

  • TOL – [in]

    TOL is REAL

    User defined tolerance. If TOL < 0, then N*U*MAX(A(K,K)) will be used. The algorithm terminates at the (K-1)st step if the pivot <= TOL.

  • LDA – [in]

    LDA is INTEGER

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

  • WORK – [out]

    WORK is REAL array, dimension (2*N)

    Work space.

  • INFO – [out]

    INFO is INTEGER

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

    = 0: algorithm completed successfully, and

    > 0: the matrix A is either rank deficient with computed rank as returned in RANK, or is not positive semidefinite. See Section 7 of LAPACK Working Note #161 for further information.

template<typename T, typename Ta>
void pstf2(char *uplo, integer *n, T *a, integer *lda, integer *piv, integer *rank, Ta *tol, Ta *work, integer *info)#

POTRS#

group potrs

Functions

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

POTRS solves a system of linear equations A*X = B.

Purpose:

  POTRS solves a system of linear equations A*X = B with a symmetric
  positive definite matrix A using the Cholesky factorization
  A = U**T*U or A = L*L**T computed by SPOTRF.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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 triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

  • LDA – [in]

    LDA is INTEGER

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

  • 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

POTRI#

group potri

Functions

template<typename T>
void potri(char *uplo, integer *n, T *buff_A, integer *ldim_A, integer *info)#

Inverse of a real symmetric positive definite matrix.

Purpose:

    Computation of the inverse of a real symmetric positive definite matrix a using the
    Cholesky factorization A = U**T*U or A = L*L**T computed by SPOTRF.

Parameters:
  • uplo – [in]

    uplo is char*

    = ‘U’: Upper triangle of a is stored;

    = ‘L’: Lower triangle of a is stored.

  • n – [in]

    n is integer*

    The order of the matrix a. n >= 0.

  • a – [inout]

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

    On entry, the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

    On exit, the upper or lower triangle of the (symmetric) inverse of A, overwriting the input factor U or L.

  • lda – [in]

    lda is integer*

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

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the (i,i) element of the factor U or L is zero, and the inverse could not be computed.

PORFS#

group porfs

Functions

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

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

Purpose:

  PORFS improves the computed solution to a system of linear
  equations when the coefficient matrix is symmetric positive definite,
  and provides error bounds and backward error estimates for the
  solution.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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 symmetric matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

  • 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 triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

  • LDAF – [in]

    LDAF is INTEGER

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

  • 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 SPOTRS. 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 porfs(char *uplo, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#

PORFSX#

group porfsx

Functions

template<typename T>
void porfsx(char *uplo, char *equed, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, T *s, 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)#

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

Purpose:

    PORFSX improves the computed solution to a system of linear
    equations when the coefficient matrix is symmetric positive
    definite, and provides error bounds and backward error estimates
    for the solution.  In addition to normwise error bound, the code
    provides maximum componentwise error bound if possible.  See
    comments for ERR_BNDS_NORM and ERR_BNDS_COMP for details of the
    error bounds.

    The original system of linear equations may have been equilibrated
    before calling this routine, as described by arguments EQUED and S
    below. In this case, the solution and error bounds returned are
    for the original unequilibrated system.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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

    = ‘Y’: Both row and column equilibration, i.e., A has been replaced by diag(S) * A * diag(S). 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 symmetric matrix A. If UPLO = ‘U’, the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

  • 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 triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

  • LDAF – [in]

    LDAF is INTEGER

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

  • S – [inout]

    S is REAL array, dimension (N)

    The scale factors for A. If EQUED = ‘Y’, A is multiplied on the left and right by diag(S). S is an input argument if FACT = ‘F’; otherwise, S is an output argument. If FACT = ‘F’ and EQUED = ‘Y’, each element of S must be positive. If S is output, each element of S is a power of the radix. If S is input, each element of S 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.

    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 REAL array, dimension (4*N)

  • IWORK – [out] IWORK is INTEGER array, dimension (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 porfsx(char *uplo, char *equed, integer *n, integer *nrhs, T *a, integer *lda, T *af, integer *ldaf, Ta *s, 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)#

POEQU#

group poequ

Functions

template<typename T>
void poequ(integer *n, T *a, integer *lda, T *s, T *scond, T *amax, integer *info)#

POEQU computes row and column scalings.

Purpose:

  POEQU computes row and column scalings intended to equilibrate a
  symmetric positive definite matrix A and reduce its condition number
  (with respect to the two-norm).  S contains the scale factors,
  S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with
  elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal.  This
  choice of S puts the condition number of B within a factor N of the
  smallest possible condition number over all possible diagonal
  scalings.

Parameters:
  • N – [in]

    N is INTEGER

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

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The N-by-N symmetric positive definite matrix whose scaling factors are to be computed. Only the diagonal elements of A are referenced.

  • LDA – [in]

    LDA is INTEGER

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

  • S – [out]

    S is REAL array, dimension (N)

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

  • SCOND – [out]

    SCOND is REAL

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

  • 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, the i-th diagonal element is nonpositive.

template<typename T, typename Ta>
void poequ(integer *n, T *a, integer *lda, Ta *s, Ta *scond, Ta *amax, integer *info)#

POEQUB#

group poequb

Functions

template<typename T>
void poequb(integer *n, T *a, integer *lda, T *s, T *scond, T *amax, integer *info)#

POEQUB computes row and column scalings.

Purpose:

  POEQUB computes row and column scalings intended to equilibrate a
  symmetric positive definite matrix A and reduce its condition number
  (with respect to the two-norm).  S contains the scale factors,
  S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with
  elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal.  This
  choice of S puts the condition number of B within a factor N of the
  smallest possible condition number over all possible diagonal
  scalings.

  This routine differs from SPOEQU 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 diagonal entries are no longer approximately 1 but lie
  between sqrt(radix) and 1/sqrt(radix).

Parameters:
  • N – [in]

    N is INTEGER

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

  • A – [in]

    A is REAL array, dimension (LDA,N)

    The N-by-N symmetric positive definite matrix whose scaling factors are to be computed. Only the diagonal elements of A are referenced.

  • LDA – [in]

    LDA is INTEGER

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

  • S – [out]

    S is REAL array, dimension (N)

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

  • SCOND – [out]

    SCOND is REAL

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

  • 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, the i-th diagonal element is nonpositive.

template<typename T, typename Ta>
void poequb(integer *n, T *a, integer *lda, Ta *s, Ta *scond, Ta *amax, integer *info)#

LAQHE#

group laqhe

Functions

template<typename T, typename Ta>
void laqhe(char *uplo, integer *n, T *a, integer *lda, Ta *s, Ta *scond, Ta *amax, char *equed)#

LAQHE scales a Hermitian matrix.

Purpose:

   LAQHE equilibrates a Hermitian matrix A using the scaling factors
   in the vector S.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored.

    = ‘U’: Upper triangular

    = ‘L’: Lower triangular

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is COMPLEX array, dimension (LDA,N)

    On entry, the Hermitian matrix A. If UPLO = ‘U’, the leading n by n upper triangular part of A contains the upper triangular part of the matrix A, and the strictly lower triangular part of A is not referenced. If UPLO = ‘L’, the leading n by n lower triangular part of A contains the lower triangular part of the matrix A, and the strictly upper triangular part of A is not referenced.

    On exit, if EQUED = ‘Y’, the equilibrated matrix: diag(S) * A * diag(S).

  • LDA – [in]

    LDA is INTEGER

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

  • S – [in]

    S is REAL array, dimension (N)

    The scale factors for A.

  • SCOND – [in]

    SCOND is REAL

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

  • AMAX – [in]

    AMAX is REAL

    Absolute value of largest matrix entry.

  • EQUED – [out]

    EQUED is CHARACTER*1

    Specifies whether or not equilibration was done.

    = ‘N’: No equilibration.

    = ‘Y’: Equilibration was done, i.e., A has been replaced by diag(S) * A * diag(S).

LA_PORCOND#

group la_porcond

Functions

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

LA_PORCOND estimates the Skeel condition number for a symmetric positive-definite matrix.

Purpose:

   LA_PORCOND 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:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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 triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

  • LDAF – [in]

    LDAF is INTEGER

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

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

LA_PORCONDX#

group la_porcondx

Functions

template<typename T, typename Ta>
Ta la_porcond_x(char *uplo, integer *n, T *a, integer *lda, T *af, integer *ldaf, T *x, integer *info, T *work, Ta *rwork)#

LA_PORCOND_X computes the infinity norm condition number of op(A)*diag(x) for Hermitian positive-definite matrices.

Purpose:

   LA_PORCOND_X Computes the infinity norm condition number of
   op(A) * diag(X) where X is a COMPLEX vector.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • A – [in]

    A is COMPLEX 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 COMPLEX array, dimension (LDAF,N)

    The triangular factor U or L from the Cholesky factorization A = U**H*U or A = L*L**H, as computed by CPOTRF.

  • LDAF – [in]

    LDAF is INTEGER

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

  • X – [in]

    X is COMPLEX array, dimension (N)

    The vector X in the formula op(A) * diag(X).

  • INFO – [out]

    INFO is INTEGER

    = 0: Successful exit.

    i > 0: The ith argument is invalid.

  • WORK – [out]

    WORK is COMPLEX array, dimension (2*N).

    Workspace.

  • RWORK – [out]

    RWORK is REAL array, dimension (N).

    Workspace.

LA_PORPVGRW#

group la_porpvgrw

Functions

template<typename T>
T la_porpvgrw(char *uplo, integer *ncols, T *a, integer *lda, T *af, integer *ldaf, T *work)#

LA_PORPVGRW computes the reciprocal pivot growth factor norm(A)/norm(U) for a symmetric or Hermitian positive-definite matrix.

Purpose:

   LA_PORPVGRW computes the reciprocal pivot growth factor
   norm(A)/norm(U). The "max absolute element" norm is used. If this is
   much less than 1, the stability of the LU factorization of the
   (equilibrated) matrix A could be poor. This also means that the
   solution X, estimated condition numbers, and error bounds could be
   unreliable.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • 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 triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPOTRF.

  • LDAF – [in]

    LDAF is INTEGER

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

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

template<typename T, typename Ta>
Ta la_porpvgrw(char *uplo, integer *ncols, T *a, integer *lda, T *af, integer *ldaf, Ta *work)#

PPCON#

group ppcon

Functions

template<typename T>
void ppcon(char *uplo, integer *n, T *ap, T *anorm, T *rcond, T *work, integer *iwork, integer *info)#

PPCON estimates the reciprocal of the condition number.

Purpose:

  PPCON estimates the reciprocal of the condition number (in the
  1-norm) of a real symmetric positive definite packed matrix using
  the Cholesky factorization A = U**T*U or A = L*L**T computed by
  PPTRF.

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

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • AP – [in]

    AP is REAL array, dimension (N*(N+1)/2)

    The triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, packed columnwise in a linear array. The j-th column of U or L is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.

  • ANORM – [in]

    ANORM is REAL

    The 1-norm (or infinity-norm) of the symmetric 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 (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 ppcon(char *uplo, integer *n, T *ap, Ta *anorm, Ta *rcond, T *work, Ta *rwork, integer *info)#

PPTRF#

group pptrf

Functions

template<typename T>
void pptrf(char *uplo, integer *n, T *ap, integer *info)#

PPTRF computes the Cholesky factorization of a real symmetric matrix.

Purpose:

    PPTRF computes the Cholesky factorization of a real symmetric
    positive definite matrix A stored in packed format.

    The factorization has the form
       A = U**T * U,  if UPLO = 'U', or
       A = L  * L**T,  if UPLO = 'L',
    where U is an upper triangular matrix and L is lower triangular.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • AP – [inout]

    AP is REAL array, dimension (N*(N+1)/2)

    On entry, the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

    See below for further details.

    On exit, if INFO = 0, the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, in the same storage format as A.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

PPTRS#

group pptrs

Functions

template<typename T>
void pptrs(char *uplo, integer *n, integer *nrhs, T *ap, T *b, integer *ldb, integer *info)#

PPTRS solves a system of linear equations A*X = B with a symmetric matrix.

Purpose:

  PPTRS solves a system of linear equations A*X = B with a symmetric
  positive definite matrix A in packed storage using the Cholesky
  factorization A = U**T*U or A = L*L**T computed by PPTRF.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

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

  • AP – [in]

    AP is REAL array, dimension (N*(N+1)/2)

    The triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, packed columnwise in a linear array. The j-th column of U or L is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.

  • 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

PPTRI#

group pptri

Functions

template<typename T>
void pptri(char *uplo, integer *n, T *ap, integer *info)#

PPTRI computes the inverse of a real symmetric matrix.

Purpose:

    PPTRI computes the inverse of a real symmetric positive definite
    matrix A using the Cholesky factorization A = U**T*U or A = L*L**T
    computed by PPTRF.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangular factor is stored in AP;

    = ‘L’: Lower triangular factor is stored in AP.

  • N – [in]

    N is INTEGER

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

  • AP – [inout]

    AP is REAL array, dimension (N*(N+1)/2)

    On entry, the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, packed columnwise as a linear array. The j-th column of U or L is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = U(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = L(i,j) for j<=i<=n.

    On exit, the upper or lower triangle of the (symmetric) inverse of A, overwriting the input factor U or L.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the (i,i) element of the factor U or L is zero, and the inverse could not be computed.

PPRFS#

group pprfs

/

Purpose:

 PPRFS improves the computed solution to a system of linear
 equations when the coefficient matrix is symmetric positive definite
 and packed, and provides error bounds and backward error estimates
 for the solution.

param UPLO:

[in]

UPLO is CHARACTER*1

= ‘U’: Upper triangle of A is stored;

= ‘L’: Lower triangle of A is stored.

param N:

[in]

N is INTEGER

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

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

param AP:

[in]

AP is REAL array, dimension (N*(N+1)/2)

The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

param AFP:

[in]

AFP is REAL array, dimension (N*(N+1)/2)

The triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T, as computed by SPPTRF/CPPTRF, packed columnwise in a linear array in the same format as A (see AP).

param B:

[in]

B is REAL array, dimension (LDB,NRHS)

The right hand side matrix B.

param LDB:

[in]

LDB is INTEGER

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

param X:

[inout]

X is REAL array, dimension (LDX,NRHS)

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

param LDX:

[in]

LDX is INTEGER

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

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

param 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).

param WORK:

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

param IWORK:

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

param INFO:

[out]

INFO is INTEGER

= 0: successful exit

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

Functions

template<typename T>
void pprfs(char *uplo, integer *n, integer *nrhs, T *ap, T *afp, T *b, integer *ldb, T *x, integer *ldx, T *ferr, T *berr, T *work, integer *iwork, integer *info)#
template<typename T, typename Ta>
void pprfs(char *uplo, integer *n, integer *nrhs, T *ap, T *afp, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#

PPEQU#

group ppequ

Functions

template<typename T>
void ppequ(char *uplo, integer *n, T *ap, T *s, T *scond, T *amax, integer *info)#

PPEQU computes row and column scalings.

Purpose:

  PPEQU computes row and column scalings intended to equilibrate a
  symmetric positive definite matrix A in packed storage and reduce
  its condition number (with respect to the two-norm).  S contains the
  scale factors, S(i)=1/sqrt(A(i,i)), chosen so that the scaled matrix
  B with elements B(i,j)=S(i)*A(i,j)*S(j) has ones on the diagonal.
  This choice of S puts the condition number of B within a factor N of
  the smallest possible condition number over all possible diagonal
  scalings.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • AP – [in]

    AP is REAL array, dimension (N*(N+1)/2)

    The upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

  • S – [out]

    S is REAL array, dimension (N)

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

  • SCOND – [out]

    SCOND is REAL

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

  • 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, the i-th diagonal element is nonpositive.

template<typename T, typename Ta>
void ppequ(char *uplo, integer *n, T *ap, Ta *s, Ta *scond, Ta *amax, integer *info)#

LAQHP#

group laqhp

Functions

template<typename T, typename Ta>
void laqhp(char *uplo, integer *n, T *ap, Ta *s, Ta *scond, Ta *amax, char *equed)#

LAQHP scales a Hermitian matrix stored in packed form.

Purpose:

   LAQHP equilibrates a Hermitian matrix A using the scaling factors
   in the vector S.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies whether the upper or lower triangular part of the Hermitian matrix A is stored.

    = ‘U’: Upper triangular

    = ‘L’: Lower triangular

  • N – [in]

    N is INTEGER

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

  • AP – [inout]

    AP is COMPLEX array, dimension (N*(N+1)/2)

    On entry, the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array AP as follows:

    if UPLO = ‘U’, AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;

    if UPLO = ‘L’, AP(i + (j-1)*(2n-j)/2) = A(i,j) for j<=i<=n.

    On exit, the equilibrated matrix: diag(S) * A * diag(S), in the same storage format as A.

  • S – [in]

    S is REAL array, dimension (N)

    The scale factors for A.

  • SCOND – [in]

    SCOND is REAL

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

  • AMAX – [in]

    AMAX is REAL

    Absolute value of largest matrix entry.

  • EQUED – [out]

    EQUED is CHARACTER*1

    Specifies whether or not equilibration was done.

    = ‘N’: No equilibration.

    = ‘Y’: Equilibration was done, i.e., A has been replaced by diag(S) * A * diag(S).

PETRF#

group petrf

Functions

template<typename T>
void pftrf(char *transr, char *uplo, integer *n, T *a, integer *info)#

PFTRF computes the Cholesky factorization.

Purpose:

    PFTRF computes the Cholesky factorization of a real symmetric
    positive definite matrix A.

    The factorization has the form
       A = U**T * U,  if UPLO = 'U', or
       A = L  * L**T,  if UPLO = 'L',
    where U is an upper triangular matrix and L is lower triangular.

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

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: The Normal TRANSR of RFP A is stored;

    = ‘T’: The Transpose TRANSR of RFP A is stored.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of RFP A is stored;

    = ‘L’: Lower triangle of RFP A is stored.

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension ( N*(N+1)/2);

    On entry, the symmetric matrix A in RFP format. RFP format is described by TRANSR, UPLO, and N as follows: If TRANSR = ‘N’ then RFP A is (0:N,0:k-1) when N is even; k=N/2. RFP A is (0:N-1,0:k) when N is odd; k=N/2. IF TRANSR = ‘T’ then RFP is the transpose of RFP A as defined when TRANSR = ‘N’. The contents of RFP A are defined by UPLO as follows: If UPLO = ‘U’ the RFP A contains the NT elements of upper packed A. If UPLO = ‘L’ the RFP A contains the elements of lower packed A. The LDA of RFP A is (N+1)/2 when TRANSR = ‘T’. When TRANSR is ‘N’ the LDA is N+1 when N is even and N is odd. See the Note below for more details.

    On exit, if INFO = 0, the factor U or L from the Cholesky factorization RFP A = U**T*U or RFP A = L*L**T.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

PFRS#

group pfrs

Functions

template<typename T>
void pftrs(char *transr, char *uplo, integer *n, integer *nrhs, T *a, T *b, integer *ldb, integer *info)#

PFTRS solves a system of linear equations A*X = B with a symmetric positive definite matrix.

Purpose:

    PFTRS solves a system of linear equations A*X = B with a symmetric
    positive definite matrix A using the Cholesky factorization
    A = U**T*U or A = L*L**T computed by PFTRF.

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: The Normal TRANSR of RFP A is stored;

    = ‘T’: The Transpose TRANSR of RFP A is stored.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of RFP A is stored;

    = ‘L’: Lower triangle of RFP A is stored.

  • 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 ( N*(N+1)/2)

    The triangular factor U or L from the Cholesky factorization of RFP A = U**H*U or RFP A = L*L**T, as computed by SPFTRF. See note below for more details about RFP A.

  • 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

PFTRI#

group pftri

Functions

template<typename T>
void pftri(char *transr, char *uplo, integer *n, T *a, integer *info)#

PFTRI computes the inverse of a real (symmetric) positive definite matrix.

Purpose:

    PFTRI computes the inverse of a real (symmetric) positive definite
    matrix A using the Cholesky factorization A = U**T*U or A = L*L**T
    computed by PFTRF.

Parameters:
  • TRANSR – [in]

    TRANSR is CHARACTER*1

    = ‘N’: The Normal TRANSR of RFP A is stored;

    = ‘T’: The Transpose TRANSR of RFP A is stored.

  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • A – [inout]

    A is REAL array, dimension ( N*(N+1)/2)

    On entry, the symmetric matrix A in RFP format. RFP format is described by TRANSR, UPLO, and N as follows: If TRANSR = ‘N’ then RFP A is (0:N,0:k-1) when N is even; k=N/2. RFP A is (0:N-1,0:k) when N is odd; k=N/2. IF TRANSR = ‘T’ then RFP is the transpose of RFP A as defined when TRANSR = ‘N’. The contents of RFP A are defined by UPLO as follows: If UPLO = ‘U’ the RFP A contains the nt elements of upper packed A. If UPLO = ‘L’ the RFP A contains the elements of lower packed A. The LDA of RFP A is (N+1)/2 when TRANSR = ‘T’. When TRANSR is ‘N’ the LDA is N+1 when N is even and N is odd. See the Note below for more details.

    On exit, the symmetric inverse of the original matrix, in the same storage format.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the (i,i) element of the factor U or L is zero, and the inverse could not be computed.

PBCON#

group pbcon

Functions

template<typename T>
void pbcon(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, T *anorm, T *rcond, T *work, integer *iwork, integer *info)#

PBCON estimates the reciprocal of the condition number.

Purpose:

  PBCON estimates the reciprocal of the condition number (in the
  1-norm) of a real symmetric positive definite band matrix using the
  Cholesky factorization A = U**T*U or A = L*L**T computed by SPBTRF.

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

    UPLO is CHARACTER*1

    = ‘U’: Upper triangular factor stored in AB;

    = ‘L’: Lower triangular factor stored in AB.

  • N – [in]

    N is INTEGER

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

  • KD – [in]

    KD is INTEGER

    The number of superdiagonals of the matrix A if UPLO = ‘U’, or the number of subdiagonals if UPLO = ‘L’. KD >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the band matrix A, stored in the first KD+1 rows of the array. The j-th column of U or L is stored in the j-th column of the array AB as follows: if UPLO =’U’, AB(kd+1+i-j,j) = U(i,j) for fla_max(1,j-kd)<=i<=j; if UPLO =’L’, AB(1+i-j,j) = L(i,j) for j<=i<=min(n,j+kd).

  • LDAB – [in]

    LDAB is INTEGER

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

  • ANORM – [in]

    ANORM is REAL

    The 1-norm (or infinity-norm) of the symmetric band 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 (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 pbcon(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, Ta *anorm, Ta *rcond, T *work, Ta *rwork, integer *info)#

PBTRF#

group pbtrf

Functions

template<typename T>
void pbtrf(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, integer *info)#

PBTRF computes the Cholesky factorization of a real symmetric

positive definite band matrix A.

Purpose:

    PBTRF computes the Cholesky factorization of a real symmetric
    positive definite band matrix A.

    The factorization has the form
       A = U**T * U,  if UPLO = 'U', or
       A = L  * L**T,  if UPLO = 'L',
    where U is an upper triangular matrix and L is lower triangular.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangle of A is stored;

    = ‘L’: Lower triangle of A is stored.

  • N – [in]

    N is INTEGER

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

  • KD – [in]

    KD is INTEGER

    The number of superdiagonals of the matrix A if UPLO = ‘U’, or the number of subdiagonals if UPLO = ‘L’. KD >= 0.

  • AB – [inout]

    AB is REAL array, dimension (LDAB,N)

    On entry, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:

    if UPLO = ‘U’, AB(kd+1+i-j,j) = A(i,j) for fla_max(1,j-kd)<=i<=j;

    if UPLO = ‘L’, AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).

    On exit, if INFO = 0, the triangular factor U or L from the Cholesky factorization A = U**T*U or A = L*L**T of the band matrix A, in the same storage format as A.

  • LDAB – [in]

    LDAB is INTEGER

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

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = i, the leading minor of order i is not positive definite, and the factorization could not be completed.

PBEQU#

group pbequ

Functions

template<typename T>
void pbequ(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, T *s, T *scond, T *amax, integer *info)#

PBEQU computes row and column scalings.

Purpose:

  PBEQU computes row and column scalings intended to equilibrate a
  symmetric positive definite band matrix A and reduce its condition
  number (with respect to the two-norm).  S contains the scale factors,
  S(i) = 1/sqrt(A(i,i)), chosen so that the scaled matrix B with
  elements B(i,j) = S(i)*A(i,j)*S(j) has ones on the diagonal.  This
  choice of S puts the condition number of B within a factor N of the
  smallest possible condition number over all possible diagonal
  scalings.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    = ‘U’: Upper triangular of A is stored;

    = ‘L’: Lower triangular of A is stored.

  • N – [in]

    N is INTEGER

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

  • KD – [in]

    KD is INTEGER

    The number of superdiagonals of the matrix A if UPLO = ‘U’, or the number of subdiagonals if UPLO = ‘L’. KD >= 0.

  • AB – [in]

    AB is REAL array, dimension (LDAB,N)

    The upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:

    if UPLO = ‘U’, AB(kd+1+i-j,j) = A(i,j) for fla_max(1,j-kd)<=i<=j;

    if UPLO = ‘L’, AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).

  • LDAB – [in]

    LDAB is INTEGER

    The leading dimension of the array A. LDAB >= KD+1.

  • S – [out]

    S is REAL array, dimension (N)

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

  • SCOND – [out]

    SCOND is REAL

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

  • 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, the i-th diagonal element is nonpositive.

template<typename T, typename Ta>
void pbequ(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, T *s, Ta *scond, Ta *amax, integer *info)#

LAQHB#

group laqhb

Functions

template<typename T, typename Ta>
void laqhb(char *uplo, integer *n, integer *kd, T *ab, integer *ldab, Ta *s, Ta *scond, Ta *amax, char *equed)#

LAQHB scales a Hermitian band matrix, using scaling factors computed by cpbequ.

Purpose:

   LAQHB equilibrates an Hermitian band matrix A using the scaling
   factors in the vector S.

Parameters:
  • UPLO – [in]

    UPLO is CHARACTER*1

    Specifies whether the upper or lower triangular part of the symmetric matrix A is stored.

    = ‘U’: Upper triangular

    = ‘L’: Lower triangular

  • N – [in]

    N is INTEGER

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

  • KD – [in]

    KD is INTEGER

    The number of super-diagonals of the matrix A if UPLO = ‘U’, or the number of sub-diagonals if UPLO = ‘L’. KD >= 0.

  • AB – [inout]

    AB is COMPLEX array, dimension (LDAB,N)

    On entry, the upper or lower triangle of the symmetric band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:

    if UPLO = ‘U’, AB(kd+1+i-j,j) = A(i,j) for fla_max(1,j-kd)<=i<=j;

    if UPLO = ‘L’, AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).

    On exit, if INFO = 0, the triangular factor U or L from the Cholesky factorization A = U**H *U or A = L*L**H of the band matrix A, in the same storage format as A.

  • LDAB – [in]

    LDAB is INTEGER

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

  • S – [out]

    S is REAL array, dimension (N)

    The scale factors for A.

  • SCOND – [in]

    SCOND is REAL

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

  • AMAX – [in]

    AMAX is REAL

    Absolute value of largest matrix entry.

  • EQUED – [out]

    EQUED is CHARACTER*1

    Specifies whether or not equilibration was done.

    = ‘N’: No equilibration.

    = ‘Y’: Equilibration was done, i.e., A has been replaced by diag(S) * A * diag(S).

PTCON#

group ptcon

Functions

template<typename T>
void ptcon(integer *n, T *d, T *e, T *anorm, T *rcond, T *rwork, integer *info)#

PTCON computes the reciprocal of the condition number.

Purpose:

  PTCON computes the reciprocal of the condition number (in the
  1-norm) of a real symmetric positive definite tridiagonal matrix
  using the factorization A = L*D*L**T or A = U**T*D*U computed by
  SPTTRF.

  Norm(inv(A)) is computed by a direct method, and the reciprocal of
  the condition number is computed as
        RCOND = 1 / (ANORM * norm(inv(A))).

Parameters:
  • N – [in]

    N is INTEGER

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

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the diagonal matrix D from the factorization of A, as computed by SPTTRF.

  • E – [in]

    E is REAL array, dimension (N-1)

    The (n-1) off-diagonal elements of the unit bidiagonal factor U or L from the factorization of A, as computed by SPTTRF.

  • ANORM – [in]

    ANORM is REAL

    The 1-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 the 1-norm of inv(A) computed in this routine.

  • 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 ptcon(integer *n, Ta *d, T *e, Ta *anorm, Ta *rcond, Ta *rwork, integer *info)#

PTTRF#

group pttrf

Functions

template<typename T>
void pttrf(integer *n, T *d, T *e, integer *info)#

PTTRF computes the L*D*L**T factorization of a real symmetric matrix.

Purpose:

  PTTRF computes the L*D*L**T factorization of a real symmetric
  positive definite tridiagonal matrix A.  The factorization may also
  be regarded as having the form A = U**T*D*U.

Parameters:
  • N – [in]

    N is INTEGER

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

  • D – [inout]

    D is REAL array, dimension (N)

    On entry, the n diagonal elements of the tridiagonal matrix A. On exit, the n diagonal elements of the diagonal matrix D from the L*D*L**T factorization of A.

  • E – [inout]

    E is REAL array, dimension (N-1)

    On entry, the (n-1) subdiagonal elements of the tridiagonal matrix A. On exit, the (n-1) subdiagonal elements of the unit bidiagonal factor L from the L*D*L**T factorization of A.

    E can also be regarded as the superdiagonal of the unit bidiagonal factor U from the U**T*D*U factorization of A.

  • INFO – [out]

    INFO is INTEGER

    = 0: successful exit

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

    > 0: if INFO = k, the leading minor of order k is not positive definite; if k < N, the factorization could not be completed, while if k = N, the factorization was completed, but D(N) <= 0.

template<typename T, typename Ta>
void pttrf(integer *n, Ta *d, T *e, integer *info)#

PTTRS#

group pttrs

Functions

template<typename T>
void pttrs(integer *n, integer *nrhs, T *d, T *e, T *b, integer *ldb, integer *info)#

PTTRS solves a tridiagonal system of the form A * X = B.

Purpose:

  PTTRS solves a tridiagonal system of the form
     A * X = B
  using the L*D*L**T factorization of A computed by SPTTRF.  D is a
  diagonal matrix specified in the vector D, L is a unit bidiagonal
  matrix whose subdiagonal is specified in the vector E, and X and B
  are N by NRHS matrices.

Parameters:
  • N – [in]

    N is INTEGER

    The order of the tridiagonal 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.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the diagonal matrix D from the L*D*L**T factorization of A.

  • E – [in]

    E is REAL array, dimension (N-1)

    The (n-1) subdiagonal elements of the unit bidiagonal factor L from the L*D*L**T factorization of A. E can also be regarded as the superdiagonal of the unit bidiagonal factor U from the factorization A = U**T*D*U.

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the right hand side vectors B for the system of linear equations.

    On exit, 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 = -k, the k-th argument had an illegal value

template<typename T, typename Ta>
void pttrs(char *uplo, integer *n, integer *nrhs, Ta *d, T *e, T *b, integer *ldb, integer *info)#

PTTS2#

group ptts2

Functions

template<typename T>
void ptts2(integer *n, integer *nrhs, T *d, T *e, T *b, integer *ldb)#

PTTS2 solves a tridiagonal system of the form AX=B using

the L D LH factorization computed by spttrf.

Purpose:

 PTTS2 solves a tridiagonal system of the form
    A * X = B
 using the L*D*L**T factorization of A computed by SPTTRF.  D is a
 diagonal matrix specified in the vector D, L is a unit bidiagonal
 matrix whose subdiagonal is specified in the vector E, and X and B
 are N by NRHS matrices.

Parameters:
  • N – [in]

    N is INTEGER

    The order of the tridiagonal 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.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the diagonal matrix D from the L*D*L**T factorization of A.

  • E – [in]

    E is REAL array, dimension (N-1)

    The (n-1) subdiagonal elements of the unit bidiagonal factor L from the L*D*L**T factorization of A. E can also be regarded as the superdiagonal of the unit bidiagonal factor U from the factorization A = U**T*D*U.

  • B – [inout]

    B is REAL array, dimension (LDB,NRHS)

    On entry, the right hand side vectors B for the system of linear equations.

    On exit, the solution vectors, X.

  • LDB – [in]

    LDB is INTEGER

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

template<typename T, typename Ta>
void ptts2(integer *iuplo, integer *n, integer *nrhs, Ta *d, T *e, T *b, integer *ldb)#

PTRFS#

group ptrfs

Functions

template<typename T>
void ptrfs(integer *n, integer *nrhs, T *d, T *e, T *df, T *ef, T *b, integer *ldb, T *x, integer *ldx, T *ferr, T *berr, T *work, integer *info)#

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

Purpose:

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

Parameters:
  • 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.

  • D – [in]

    D is REAL array, dimension (N)

    The n diagonal elements of the tridiagonal matrix A.

  • E – [in]

    E is REAL array, dimension (N-1)

    The (n-1) subdiagonal elements of the tridiagonal matrix A.

  • DF – [in]

    DF is REAL array, dimension (N)

    The n diagonal elements of the diagonal matrix D from the factorization computed by SPTTRF.

  • EF – [in]

    EF is REAL array, dimension (N-1)

    The (n-1) subdiagonal elements of the unit bidiagonal factor L from the factorization computed by SPTTRF.

  • 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 SPTTRS. 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 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).

  • 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 (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 ptrfs(char *uplo, integer *n, integer *nrhs, Ta *d, T *e, Ta *df, T *ef, T *b, integer *ldb, T *x, integer *ldx, Ta *ferr, Ta *berr, T *work, Ta *rwork, integer *info)#