hesv_rk#

Functions

void chesv_rk(
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
          c64*  restrict A,
    const INT            lda,
          c64*  restrict E,
          INT*  restrict ipiv,
          c64*  restrict B,
    const INT            ldb,
          c64*  restrict work,
    const INT            lwork,
          INT*           info
);
void chesv_rk(const char *uplo, const INT n, const INT nrhs, c64 *restrict A, const INT lda, c64 *restrict E, INT *restrict ipiv, c64 *restrict B, const INT ldb, c64 *restrict work, const INT lwork, INT *info)#

CHESV_RK computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.

The bounded Bunch-Kaufman (rook) diagonal pivoting method is used to factor A as A = P*U*D*(U**H)*(P**T), if uplo = ‘U’, or A = P*L*D*(L**H)*(P**T), if uplo = ‘L’, where U (or L) is unit upper (or lower) triangular matrix, U**H (or L**H) is the conjugate transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

chetrf_rk is called to compute the factorization of a complex Hermitian matrix. The factored form of A is then used to solve the system of equations A * X = B by calling BLAS3 routine chetrs_3.

  • Only diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e. D(k,k)=A(k,k); (superdiagonal (or subdiagonal) elements of D are stored on exit in array E), and

  • If uplo='U': factor U in the superdiagonal part of A. If uplo='L': factor L in the subdiagonal part of A.

For more info see the description of chetrf_rk.

Parameters

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, i.e., the number of columns of the matrix B. nrhs>=0.

inout
A

Array of 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 info=0, diagonal of the block diagonal matrix D and factors U or L as computed by chetrf_rk:

in
lda

The leading dimension of the array A. lda>=max(1,n).

out
E

Array of dimension n. On exit, contains the output computed by the factorization routine chetrf_rk, i.e. the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where if uplo='U': E[i]=D(i-1,i), i=1:n-1, E[0] is set to 0; if uplo='L': E[i]=D(i+1,i), i=0:n-2, E[n-1] is set to 0. For a 1-by-1 diagonal block D(k), the element E[k] is set to 0 in both uplo='U' or uplo='L' cases. For more info see the description of chetrf_rk.

out
ipiv

Array of dimension n. Details of the interchanges and the block structure of D, as determined by chetrf_rk. For more info see the description of chetrf_rk.

inout
B

Array of dimension (ldb,nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if info=0, the n-by-nrhs solution matrix X.

in
ldb

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

out
work

Array of dimension max(1,lwork). Work array used in the factorization stage. On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The length of work. lwork>=1. For best performance of the factorization stage lwork>=n*nb, where nb is the optimal block size for chetrf_rk. If lwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued.

out
info

  • info=0: successful exit

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

  • info>0: if info=k, the matrix A is singular.

Functions

void zhesv_rk(
    const char*          uplo,
    const INT            n,
    const INT            nrhs,
          c128* restrict A,
    const INT            lda,
          c128* restrict E,
          INT*  restrict ipiv,
          c128* restrict B,
    const INT            ldb,
          c128* restrict work,
    const INT            lwork,
          INT*           info
);
void zhesv_rk(const char *uplo, const INT n, const INT nrhs, c128 *restrict A, const INT lda, c128 *restrict E, INT *restrict ipiv, c128 *restrict B, const INT ldb, c128 *restrict work, const INT lwork, INT *info)#

ZHESV_RK computes the solution to a complex system of linear equations A * X = B, where A is an N-by-N Hermitian matrix and X and B are N-by-NRHS matrices.

The bounded Bunch-Kaufman (rook) diagonal pivoting method is used to factor A as A = P*U*D*(U**H)*(P**T), if uplo = ‘U’, or A = P*L*D*(L**H)*(P**T), if uplo = ‘L’, where U (or L) is unit upper (or lower) triangular matrix, U**H (or L**H) is the conjugate transpose of U (or L), P is a permutation matrix, P**T is the transpose of P, and D is Hermitian and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.

zhetrf_rk is called to compute the factorization of a complex Hermitian matrix. The factored form of A is then used to solve the system of equations A * X = B by calling BLAS3 routine zhetrs_3.

  • Only diagonal elements of the Hermitian block diagonal matrix D on the diagonal of A, i.e. D(k,k)=A(k,k); (superdiagonal (or subdiagonal) elements of D are stored on exit in array E), and

  • If uplo='U': factor U in the superdiagonal part of A. If uplo='L': factor L in the subdiagonal part of A.

For more info see the description of zhetrf_rk.

Parameters

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, i.e., the number of columns of the matrix B. nrhs>=0.

inout
A

Array of 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 info=0, diagonal of the block diagonal matrix D and factors U or L as computed by zhetrf_rk:

in
lda

The leading dimension of the array A. lda>=max(1,n).

out
E

Array of dimension n. On exit, contains the output computed by the factorization routine zhetrf_rk, i.e. the superdiagonal (or subdiagonal) elements of the Hermitian block diagonal matrix D with 1-by-1 or 2-by-2 diagonal blocks, where if uplo='U': E[i]=D(i-1,i), i=1:n-1, E[0] is set to 0; if uplo='L': E[i]=D(i+1,i), i=0:n-2, E[n-1] is set to 0. For a 1-by-1 diagonal block D(k), the element E[k] is set to 0 in both uplo='U' or uplo='L' cases. For more info see the description of zhetrf_rk.

out
ipiv

Array of dimension n. Details of the interchanges and the block structure of D, as determined by zhetrf_rk. For more info see the description of zhetrf_rk.

inout
B

Array of dimension (ldb,nrhs). On entry, the n-by-nrhs right hand side matrix B. On exit, if info=0, the n-by-nrhs solution matrix X.

in
ldb

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

out
work

Array of dimension max(1,lwork). Work array used in the factorization stage. On exit, if info=0, work[0] returns the optimal lwork.

in
lwork

The length of work. lwork>=1. For best performance of the factorization stage lwork>=n*nb, where nb is the optimal block size for zhetrf_rk. If lwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued.

out
info

  • info=0: successful exit

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

  • info>0: if info=k, the matrix A is singular.