F07ANF (ZGESV) computes the solution to a complex system of linear equations
where
A is an
n by
n matrix and
X and
B are
n by
r matrices.
F07ANF (ZGESV) uses the
LU decomposition with partial pivoting and row interchanges to factor
A as
where
P is a permutation matrix,
L is unit lower triangular, and
U is upper triangular. The factored form of
A is then used to solve the system of equations
AX=B.
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (1996)
Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
- 1: N – INTEGERInput
On entry: n, the number of linear equations, i.e., the order of the matrix A.
Constraint:
N≥0.
- 2: NRHS – INTEGERInput
On entry: r, the number of right-hand sides, i.e., the number of columns of the matrix B.
Constraint:
NRHS≥0.
- 3: A(LDA,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
max1,N.
On entry: the n by n coefficient matrix A.
On exit: the factors L and U from the factorization A=PLU; the unit diagonal elements of L are not stored.
- 4: LDA – INTEGERInput
On entry: the first dimension of the array
A as declared in the (sub)program from which F07ANF (ZGESV) is called.
Constraint:
LDA≥max1,N.
- 5: IPIV(N) – INTEGER arrayOutput
On exit: if no constraints are violated, the pivot indices that define the permutation matrix P; at the ith step row i of the matrix was interchanged with row IPIVi. IPIVi=i indicates a row interchange was not required.
- 6: B(LDB,*) – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
B
must be at least
max1,NRHS.
On entry: the n by r right-hand side matrix B.
On exit: if INFO=0, the n by r solution matrix X.
- 7: LDB – INTEGERInput
On entry: the first dimension of the array
B as declared in the (sub)program from which F07ANF (ZGESV) is called.
Constraint:
LDB≥max1,N.
- 8: INFO – INTEGEROutput
On exit:
INFO=0 unless the routine detects an error (see
Section 6).
The computed solution for a single right-hand side,
x^
, satisfies the equation of the form
where
and
ε
is the
machine precision. An approximate error bound for the computed solution is given by
where
κA
=
A-1
1
A
1
, the condition number of
A
with respect to the solution of the linear equations. See Section 4.4 of
Anderson et al. (1999) for further details.
Following the use of F07ANF (ZGESV),
F07AUF (ZGECON) can be used to estimate the condition number of
A
and
F07AVF (ZGERFS) can be used to obtain approximate error bounds. Alternatives to F07ANF (ZGESV), which return condition and error estimates directly are
F04CAF and
F07APF (ZGESVX).
The real analogue of this routine is
F07AAF (DGESV).
This example solves the equations
where
A is the general matrix