zcgesv#

Functions

void zcgesv(
    const INT            n,
    const INT            nrhs,
          c128* restrict A,
    const INT            lda,
          INT*  restrict ipiv,
    const c128* restrict B,
    const INT            ldb,
          c128* restrict X,
    const INT            ldx,
          c128* restrict work,
          c64*  restrict swork,
          f64*  restrict rwork,
          INT*           iter,
          INT*           info
);
void zcgesv(const INT n, const INT nrhs, c128 *restrict A, const INT lda, INT *restrict ipiv, const c128 *restrict B, const INT ldb, c128 *restrict X, const INT ldx, c128 *restrict work, c64 *restrict swork, f64 *restrict rwork, INT *iter, INT *info)#

ZCGESV computes the solution to a complex system of linear equations.

A * X = B

where A is an n-by-n matrix and X and B are n-by-nrhs matrices.

ZCGESV first attempts to factorize the matrix in COMPLEX and use this factorization within an iterative refinement procedure to produce a solution with COMPLEX*16 normwise backward error quality (see below). If the approach fails the method switches to a COMPLEX*16 factorization and solve.

The iterative refinement process is stopped if:

ITER > ITERMAX

or for all the RHS we have:

RNRM < SQRT(N)*XNRM*ANRM*EPS*BWDMAX

where

  • ITER is the number of the current iteration in the iterative refinement process

  • RNRM is the infinity-norm of the residual

  • XNRM is the infinity-norm of the solution

  • ANRM is the infinity-operator-norm of the matrix A

  • EPS is the machine epsilon returned by DLAMCH(‘Epsilon’)

The value ITERMAX and BWDMAX are fixed to 30 and 1.0D+00 respectively.

Parameters

in
n

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

in
nrhs

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

inout
A

Array of dimension (lda, n). On entry, the n-by-n coefficient matrix A. On exit, if iterative refinement succeeded (iter>=0), A is unchanged. If COMPLEX*16 factorization was used (iter<0), A contains the factors L and U from A = P*L*U.

in
lda

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

out
ipiv

Array of dimension n. The pivot indices.

in
B

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

in
ldb

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

out
X

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

in
ldx

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

out
work

Complex*16 workspace for residual vectors. Array of dimension (n, nrhs).

out
swork

Complex (single precision) workspace for matrix and solutions. Array of dimension n*(n+nrhs).

out
rwork

Double precision array, dimension (n).

out
iter

Iteration count:

  • iter<0: iterative refinement has failed, COMPLEX*16 factorization has been performed

    • -1 : the routine fell back to full precision for implementation- or machine-specific reasons

    • -2 : narrowing the precision induced an overflow, the routine fell back to full precision

    • -3 : failure of CGETRF

    • -31: stop the iterative refinement after the 30th iterations

  • iter>0: iterative refinement has been successfully used. Returns the number of iterations

out
info

  • info=0: successful exit

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

  • info>0: if info=i, U(i,i) is exactly zero