Developer Reference

  • 2020.2
  • 07/15/2020
  • Public Content
Contents

?gesv

Computes the solution to the system of linear equations with a square coefficient matrix A and multiple right-hand sides.

Syntax

call sgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
info
)
call dgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
info
)
call cgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
info
)
call zgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
info
)
call dsgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
x
,
ldx
,
work
,
swork
,
iter
,
info
)
call zcgesv
(
n
,
nrhs
,
a
,
lda
,
ipiv
,
b
,
ldb
,
x
,
ldx
,
work
,
swork
,
rwork
,
iter
,
info
)
call gesv
(
a
,
b
[
,
ipiv
]
[
,
info
]
)
Include Files
  • mkl.fi
    ,
    lapack.f90
Description
The routine solves for
X
the system of linear equations
A*X
=
B
, where
A
is an
n
-by-
n
matrix, the columns of matrix
B
are individual right-hand sides, and the columns of
X
are the corresponding solutions.
The
LU
decomposition with partial pivoting and row interchanges is used to factor
A
as
A
=
P*L*U
, 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
A*X
=
B
.
The
dsgesv
and
zcgesv
are mixed precision iterative refinement subroutines for exploiting fast single precision hardware. They first attempt to factorize the matrix in single precision (
dsgesv
) or single complex precision (
zcgesv
) and use this factorization within an iterative refinement procedure to produce a solution with double precision (
dsgesv
) / double complex precision (
zcgesv
) normwise backward error quality (see below). If the approach fails, the method switches to a double precision or double complex precision factorization respectively and computes the solution.
The iterative refinement is not going to be a winning strategy if the ratio single precision performance over double precision performance is too small. A reasonable strategy should take the number of right-hand sides and the size of the matrix into account. This might be done with a call to
ilaenv
in the future. At present, iterative refinement is implemented.
The iterative refinement process is stopped if
iter > itermax
or for all the right-hand sides:
rnmr < sqrt(n)*xnrm*anrm*eps*bwdmax
where