spsvx#

Functions

void sspsvx(
    const char*          fact,
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
    const f32*  restrict AP,
          f32*  restrict AFP,
          INT*  restrict ipiv,
    const f32*  restrict B,
    const INT            ldb,
          f32*  restrict X,
    const INT            ldx,
          f32*           rcond,
          f32*  restrict ferr,
          f32*  restrict berr,
          f32*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void sspsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const f32 *restrict AP, f32 *restrict AFP, INT *restrict ipiv, const f32 *restrict B, const INT ldb, f32 *restrict X, const INT ldx, f32 *rcond, f32 *restrict ferr, f32 *restrict berr, f32 *restrict work, INT *restrict iwork, INT *info)#

SSPSVX uses the diagonal pivoting factorization A = U*D*U**T or A = L*D*L**T to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix stored in packed format and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed:

  1. If fact='N', the diagonal pivoting method is used to factor A as

    A = U * D * U**T,  if uplo = 'U', or
    A = L * D * L**T,  if uplo = 'L',
    

    where U (or L) is a product of permutation and unit upper (lower) triangular matrices and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

  2. If some D(i,i)=0, so that D is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  3. The system of equations is solved for X using the factored form of A.

  4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

Further Details:

The packed storage scheme is illustrated by the following example when n=4, uplo='U':

Two-dimensional storage of the symmetric matrix A:

a00 a01 a02 a03
    a11 a12 a13
        a22 a23     (aij = aji)
            a33

Packed storage of the upper triangle of A:

AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]

Parameters

in
fact

  • 'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.

  • 'N': The matrix A will be copied to AFP and factored.

in
uplo

  • 'U': Upper triangle of A is stored

  • 'L': Lower triangle of A is stored

in
n

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

in
nrhs

The number of right hand sides. nrhs>=0.

in
AP

Array of 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*(j+1)/2] = A(i,j) for 0<=i<=j; if uplo='L', AP[i + j*(2*n-j-1)/2] = A(i,j) for j<=i<=n-1. See below for further details.

inout
AFP

Array of dimension n*(n+1)/2. If fact='F', then AFP is an input argument and on entry contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by ssptrf, stored as a packed triangular matrix in the same storage format as A. If fact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.

inout
ipiv

Array of dimension n. Pivot indices (0-based). If fact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined by ssptrf. If ipiv[k]>=0, then rows and columns k and ipiv[k] were interchanged and D(k,k) is a 1-by-1 diagonal block. If uplo='U' and ipiv[k]=ipiv[k-1]<0, then rows and columns k-1 and -ipiv[k]-1 were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If uplo='L' and ipiv[k]=ipiv[k+1]<0, then rows and columns k+1 and -ipiv[k]-1 were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. If fact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by ssptrf.

in
B

Array of dimension (ldb,nrhs). The n-by-nrhs right hand side matrix B.

in
ldb

The leading dimension of the array B. ldb>=max(1,n).

out
X

Array of dimension (ldx,nrhs). If info=0 or info=n+1, the n-by-nrhs solution matrix X.

in
ldx

The leading dimension of the array X. ldx>=max(1,n).

out
rcond

The estimate of the reciprocal condition number of the matrix A. If rcond is less than the machine precision (in particular, if rcond=0), the matrix is singular to working precision. This condition is indicated by a return code of info>0.

out
ferr

Array of dimension nrhs. The estimated forward error bound for each solution vector X(j).

out
berr

Array of dimension nrhs. The componentwise relative backward error of each solution vector X(j).

out
work

Array of dimension 3*n.

out
iwork

Array of dimension n.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, and i<=n, D(i,i) is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed. rcond=0 is returned.

  • info=n+1: D is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision.

Functions

void dspsvx(
    const char*          fact,
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
    const f64*  restrict AP,
          f64*  restrict AFP,
          INT*  restrict ipiv,
    const f64*  restrict B,
    const INT            ldb,
          f64*  restrict X,
    const INT            ldx,
          f64*           rcond,
          f64*  restrict ferr,
          f64*  restrict berr,
          f64*  restrict work,
          INT*  restrict iwork,
          INT*           info
);
void dspsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const f64 *restrict AP, f64 *restrict AFP, INT *restrict ipiv, const f64 *restrict B, const INT ldb, f64 *restrict X, const INT ldx, f64 *rcond, f64 *restrict ferr, f64 *restrict berr, f64 *restrict work, INT *restrict iwork, INT *info)#

DSPSVX uses the diagonal pivoting factorization A = U*D*U**T or A = L*D*L**T to compute the solution to a real system of linear equations A * X = B, where A is an N-by-N symmetric matrix stored in packed format and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed:

  1. If fact='N', the diagonal pivoting method is used to factor A as

    A = U * D * U**T,  if uplo = 'U', or
    A = L * D * L**T,  if uplo = 'L',
    

    where U (or L) is a product of permutation and unit upper (lower) triangular matrices and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

  2. If some D(i,i)=0, so that D is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  3. The system of equations is solved for X using the factored form of A.

  4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

Further Details:

The packed storage scheme is illustrated by the following example when n=4, uplo='U':

Two-dimensional storage of the symmetric matrix A:

a00 a01 a02 a03
    a11 a12 a13
        a22 a23     (aij = aji)
            a33

Packed storage of the upper triangle of A:

AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]

Parameters

in
fact

  • 'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.

  • 'N': The matrix A will be copied to AFP and factored.

in
uplo

  • 'U': Upper triangle of A is stored

  • 'L': Lower triangle of A is stored

in
n

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

in
nrhs

The number of right hand sides. nrhs>=0.

in
AP

Array of 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*(j+1)/2] = A(i,j) for 0<=i<=j; if uplo='L', AP[i + j*(2*n-j-1)/2] = A(i,j) for j<=i<=n-1. See below for further details.

inout
AFP

Array of dimension n*(n+1)/2. If fact='F', then AFP is an input argument and on entry contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by dsptrf, stored as a packed triangular matrix in the same storage format as A. If fact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.

inout
ipiv

Array of dimension n. Pivot indices (0-based). If fact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined by dsptrf. If ipiv[k]>=0, then rows and columns k and ipiv[k] were interchanged and D(k,k) is a 1-by-1 diagonal block. If uplo='U' and ipiv[k]=ipiv[k-1]<0, then rows and columns k-1 and -ipiv[k]-1 were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If uplo='L' and ipiv[k]=ipiv[k+1]<0, then rows and columns k+1 and -ipiv[k]-1 were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. If fact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by dsptrf.

in
B

Array of dimension (ldb,nrhs). The n-by-nrhs right hand side matrix B.

in
ldb

The leading dimension of the array B. ldb>=max(1,n).

out
X

Array of dimension (ldx,nrhs). If info=0 or info=n+1, the n-by-nrhs solution matrix X.

in
ldx

The leading dimension of the array X. ldx>=max(1,n).

out
rcond

The estimate of the reciprocal condition number of the matrix A. If rcond is less than the machine precision (in particular, if rcond=0), the matrix is singular to working precision. This condition is indicated by a return code of info>0.

out
ferr

Array of dimension nrhs. The estimated forward error bound for each solution vector X(j).

out
berr

Array of dimension nrhs. The componentwise relative backward error of each solution vector X(j).

out
work

Array of dimension 3*n.

out
iwork

Array of dimension n.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, and i<=n, D(i,i) is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed. rcond=0 is returned.

  • info=n+1: D is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision.

Functions

void cspsvx(
    const char*          fact,
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
    const c64*  restrict AP,
          c64*  restrict AFP,
          INT*  restrict ipiv,
    const c64*  restrict B,
    const INT            ldb,
          c64*  restrict X,
    const INT            ldx,
          f32*           rcond,
          f32*  restrict ferr,
          f32*  restrict berr,
          c64*  restrict work,
          f32*  restrict rwork,
          INT*           info
);
void cspsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c64 *restrict AP, c64 *restrict AFP, INT *restrict ipiv, const c64 *restrict B, const INT ldb, c64 *restrict X, const INT ldx, f32 *rcond, f32 *restrict ferr, f32 *restrict berr, c64 *restrict work, f32 *restrict rwork, INT *info)#

CSPSVX uses the diagonal pivoting factorization A = U*D*U**T or A = L*D*L**T to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N symmetric matrix stored in packed format and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed:

  1. If fact='N', the diagonal pivoting method is used to factor A as

    A = U * D * U**T,  if uplo = 'U', or
    A = L * D * L**T,  if uplo = 'L',
    

    where U (or L) is a product of permutation and unit upper (lower) triangular matrices and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

  2. If some D(i,i)=0, so that D is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  3. The system of equations is solved for X using the factored form of A.

  4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

Further Details:

The packed storage scheme is illustrated by the following example when n=4, uplo='U':

Two-dimensional storage of the symmetric matrix A:

a00 a01 a02 a03
    a11 a12 a13
        a22 a23     (aij = aji)
            a33

Packed storage of the upper triangle of A:

AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]

Parameters

in
fact

  • 'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.

  • 'N': The matrix A will be copied to AFP and factored.

in
uplo

  • 'U': Upper triangle of A is stored

  • 'L': Lower triangle of A is stored

in
n

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

in
nrhs

The number of right hand sides. nrhs>=0.

in
AP

Complex array of 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*(j+1)/2] = A(i,j) for 0<=i<=j; if uplo='L', AP[i + j*(2*n-j-1)/2] = A(i,j) for j<=i<=n-1. See below for further details.

inout
AFP

Complex array of dimension n*(n+1)/2. If fact='F', then AFP is an input argument and on entry contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by csptrf, stored as a packed triangular matrix in the same storage format as A. If fact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.

inout
ipiv

Array of dimension n. Pivot indices (0-based). If fact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined by csptrf. If ipiv[k]>=0, then rows and columns k and ipiv[k] were interchanged and D(k,k) is a 1-by-1 diagonal block. If uplo='U' and ipiv[k]=ipiv[k-1]<0, then rows and columns k-1 and -ipiv[k]-1 were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If uplo='L' and ipiv[k]=ipiv[k+1]<0, then rows and columns k+1 and -ipiv[k]-1 were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. If fact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by csptrf.

in
B

Complex array of dimension (ldb,nrhs). The n-by-nrhs right hand side matrix B.

in
ldb

The leading dimension of the array B. ldb>=max(1,n).

out
X

Complex array of dimension (ldx,nrhs). If info=0 or info=n+1, the n-by-nrhs solution matrix X.

in
ldx

The leading dimension of the array X. ldx>=max(1,n).

out
rcond

The estimate of the reciprocal condition number of the matrix A. If rcond is less than the machine precision (in particular, if rcond=0), the matrix is singular to working precision. This condition is indicated by a return code of info>0.

out
ferr

Array of dimension nrhs. The estimated forward error bound for each solution vector X(j).

out
berr

Array of dimension nrhs. The componentwise relative backward error of each solution vector X(j).

out
work

Complex array of dimension 2*n.

out
rwork

Array of dimension n.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, and i<=n, D(i,i) is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed. rcond=0 is returned.

  • info=n+1: D is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision.

Functions

void zspsvx(
    const char*          fact,
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
    const c128* restrict AP,
          c128* restrict AFP,
          INT*  restrict ipiv,
    const c128* restrict B,
    const INT            ldb,
          c128* restrict X,
    const INT            ldx,
          f64*           rcond,
          f64*  restrict ferr,
          f64*  restrict berr,
          c128* restrict work,
          f64*  restrict rwork,
          INT*           info
);
void zspsvx(const char *fact, const char *uplo, const INT n, const INT nrhs, const c128 *restrict AP, c128 *restrict AFP, INT *restrict ipiv, const c128 *restrict B, const INT ldb, c128 *restrict X, const INT ldx, f64 *rcond, f64 *restrict ferr, f64 *restrict berr, c128 *restrict work, f64 *restrict rwork, INT *info)#

ZSPSVX uses the diagonal pivoting factorization A = U*D*U**T or A = L*D*L**T to compute the solution to a complex system of linear equations A * X = B, where A is an N-by-N symmetric matrix stored in packed format and X and B are N-by-NRHS matrices.

Error bounds on the solution and a condition estimate are also provided.

The following steps are performed:

  1. If fact='N', the diagonal pivoting method is used to factor A as

    A = U * D * U**T,  if uplo = 'U', or
    A = L * D * L**T,  if uplo = 'L',
    

    where U (or L) is a product of permutation and unit upper (lower) triangular matrices and D is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

  2. If some D(i,i)=0, so that D is exactly singular, then the routine returns with info=i. Otherwise, the factored form of A is used to estimate the condition number of the matrix A. If the reciprocal of the condition number is less than machine precision, info=n+1 is returned as a warning, but the routine still goes on to solve for X and compute error bounds as described below.

  3. The system of equations is solved for X using the factored form of A.

  4. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.

Further Details:

The packed storage scheme is illustrated by the following example when n=4, uplo='U':

Two-dimensional storage of the symmetric matrix A:

a00 a01 a02 a03
    a11 a12 a13
        a22 a23     (aij = aji)
            a33

Packed storage of the upper triangle of A:

AP = [ a00, a01, a11, a02, a12, a22, a03, a13, a23, a33 ]

Parameters

in
fact

  • 'F': On entry, AFP and IPIV contain the factored form of A. AP, AFP and IPIV will not be modified.

  • 'N': The matrix A will be copied to AFP and factored.

in
uplo

  • 'U': Upper triangle of A is stored

  • 'L': Lower triangle of A is stored

in
n

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

in
nrhs

The number of right hand sides. nrhs>=0.

in
AP

Complex array of 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*(j+1)/2] = A(i,j) for 0<=i<=j; if uplo='L', AP[i + j*(2*n-j-1)/2] = A(i,j) for j<=i<=n-1. See below for further details.

inout
AFP

Complex array of dimension n*(n+1)/2. If fact='F', then AFP is an input argument and on entry contains the block diagonal matrix D and the multipliers used to obtain the factor U or L from the factorization A = U*D*U**T or A = L*D*L**T as computed by zsptrf, stored as a packed triangular matrix in the same storage format as A. If fact='N', then AFP is an output argument and on exit contains the block diagonal matrix D and the multipliers used to obtain the factor U or L.

inout
ipiv

Array of dimension n. Pivot indices (0-based). If fact='F', then ipiv is an input argument and on entry contains details of the interchanges and the block structure of D, as determined by zsptrf. If ipiv[k]>=0, then rows and columns k and ipiv[k] were interchanged and D(k,k) is a 1-by-1 diagonal block. If uplo='U' and ipiv[k]=ipiv[k-1]<0, then rows and columns k-1 and -ipiv[k]-1 were interchanged and D(k-1:k,k-1:k) is a 2-by-2 diagonal block. If uplo='L' and ipiv[k]=ipiv[k+1]<0, then rows and columns k+1 and -ipiv[k]-1 were interchanged and D(k:k+1,k:k+1) is a 2-by-2 diagonal block. If fact='N', then ipiv is an output argument and on exit contains details of the interchanges and the block structure of D, as determined by zsptrf.

in
B

Complex array of dimension (ldb,nrhs). The n-by-nrhs right hand side matrix B.

in
ldb

The leading dimension of the array B. ldb>=max(1,n).

out
X

Complex array of dimension (ldx,nrhs). If info=0 or info=n+1, the n-by-nrhs solution matrix X.

in
ldx

The leading dimension of the array X. ldx>=max(1,n).

out
rcond

The estimate of the reciprocal condition number of the matrix A. If rcond is less than the machine precision (in particular, if rcond=0), the matrix is singular to working precision. This condition is indicated by a return code of info>0.

out
ferr

Array of dimension nrhs. The estimated forward error bound for each solution vector X(j).

out
berr

Array of dimension nrhs. The componentwise relative backward error of each solution vector X(j).

out
work

Complex array of dimension 2*n.

out
rwork

Array of dimension n.

out
info

  • info=0: successful exit

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

  • info>0: if info=i, and i<=n, D(i,i) is exactly zero. The factorization has been completed but D is exactly singular, so the solution and error bounds could not be computed. rcond=0 is returned.

  • info=n+1: D is nonsingular, but rcond is less than machine precision, meaning that the matrix is singular to working precision.