Developer Reference

  • 0.9
  • 09/09/2020
  • Public Content
Contents

p?gesvx

Uses the
LU
factorization to compute the solution to the system of linear equations with a square matrix
A
and multiple right-hand sides, and provides error bounds on the solution.

Syntax

void
psgesvx
(
char
*fact
,
char
*trans
,
MKL_INT
*n
,
MKL_INT
*nrhs
,
float
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
float
*af
,
MKL_INT
*iaf
,
MKL_INT
*jaf
,
MKL_INT
*descaf
,
MKL_INT
*ipiv
,
char
*equed
,
float
*r
,
float
*c
,
float
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
float
*x
,
MKL_INT
*ix
,
MKL_INT
*jx
,
MKL_INT
*descx
,
float
*rcond
,
float
*ferr
,
float
*berr
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*info
);
void
pdgesvx
(
char
*fact
,
char
*trans
,
MKL_INT
*n
,
MKL_INT
*nrhs
,
double
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
double
*af
,
MKL_INT
*iaf
,
MKL_INT
*jaf
,
MKL_INT
*descaf
,
MKL_INT
*ipiv
,
char
*equed
,
double
*r
,
double
*c
,
double
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
double
*x
,
MKL_INT
*ix
,
MKL_INT
*jx
,
MKL_INT
*descx
,
double
*rcond
,
double
*ferr
,
double
*berr
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*iwork
,
MKL_INT
*liwork
,
MKL_INT
*info
);
void
pcgesvx
(
char
*fact
,
char
*trans
,
MKL_INT
*n
,
MKL_INT
*nrhs
,
MKL_Complex8
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex8
*af
,
MKL_INT
*iaf
,
MKL_INT
*jaf
,
MKL_INT
*descaf
,
MKL_INT
*ipiv
,
char
*equed
,
float
*r
,
float
*c
,
MKL_Complex8
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
MKL_Complex8
*x
,
MKL_INT
*ix
,
MKL_INT
*jx
,
MKL_INT
*descx
,
float
*rcond
,
float
*ferr
,
float
*berr
,
MKL_Complex8
*work
,
MKL_INT
*lwork
,
float
*rwork
,
MKL_INT
*lrwork
,
MKL_INT
*info
);
void
pzgesvx
(
char
*fact
,
char
*trans
,
MKL_INT
*n
,
MKL_INT
*nrhs
,
MKL_Complex16
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex16
*af
,
MKL_INT
*iaf
,
MKL_INT
*jaf
,
MKL_INT
*descaf
,
MKL_INT
*ipiv
,
char
*equed
,
double
*r
,
double
*c
,
MKL_Complex16
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
MKL_Complex16
*x
,
MKL_INT
*ix
,
MKL_INT
*jx
,
MKL_INT
*descx
,
double
*rcond
,
double
*ferr
,
double
*berr
,
MKL_Complex16
*work
,
MKL_INT
*lwork
,
double
*rwork
,
MKL_INT
*lrwork
,
MKL_INT
*info
);
Include Files
  • mkl_scalapack.h
Description
The
p?gesvx
function
uses the
LU
factorization to compute the solution to a real or complex system of linear equations
A
X
=
B
, where
A
denotes the
n
-by-
n
submatrix
A
(
ia:ia+n-1
,
ja:ja+n-1
)
,
B
denotes the
n
-by-
nrhs
submatrix
B
(
ib:ib+n-1
,
jb:jb+nrhs-1
)
and
X
denotes the
n
-by-
nrhs
submatrix
X
(
ix:ix+n-1
,
jx:jx+nrhs-1
)
.
Error bounds on the solution and a condition estimate are also provided.
In the following description,
af
stands for the subarray
of
af
from row
iaf
and column
jaf
to row
iaf+n-1
and column
jaf+n-1
.
The
function
p?gesvx
performs the following steps:
  1. If
    fact
    =
    'E'
    , real scaling factors
    R
    and
    C
    are computed to equilibrate the system:
    trans
    =
    'N'
    :
    diag(
    R
    )*
    A
    *diag(
    C
    ) *diag(
    C
    )-1*
    X
    = diag(
    R
    )*B
    trans
    =
    'T'
    :
    (diag(
    R
    )*
    A
    *diag(
    C
    ))
    T
    *diag(
    R
    )-1*
    X
    = diag(
    C
    )*B
    trans
    =
    'C'
    :
    (diag(
    R
    )*
    A
    *diag(
    C
    ))
    H
    *diag(
    R
    )-1*
    X
    = diag(
    C
    )*B
    Whether or not the system will be equilibrated depends on the scaling of the matrix
    A
    , but if equilibration is used,
    A
    is overwritten by
    diag(
    R
    )*
    A
    *diag(
    C
    )
    and
    B
    by
    diag(
    R
    )*
    B
    (if
    trans
    ='
    N
    ')
    or
    diag(
    c
    )*
    B
    (if
    trans
    =
    'T'
    or
    'C'
    ).
  2. If
    fact
    =
    'N'
    or
    'E'
    , the
    LU
    decomposition is used to factor the matrix
    A
    (after equilibration if
    fact
    =
    'E'
    )
    as
    A
    =
    P
    L
    U
    , where
    P
    is a permutation matrix,
    L
    is a unit lower triangular matrix, and
    U
    is upper triangular.
  3. 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 relative machine precision, steps 4 - 6 are skipped.
  4. The system of equations is solved for
    X
    using the factored form of
    A
    .
  5. Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
  6. If equilibration was used, the matrix
    X
    is premultiplied by diag(
    C
    ) (if
    trans
    =
    'N'
    )
    or diag(
    R
    ) (if
    trans
    =
    'T'
    or
    'C'
    ) so that it solves the original system before equilibration.
Input Parameters
fact
(global) Must be
'F'
,
'N'
, or
'E'
.
Specifies whether or not the factored form of the matrix
A
is supplied on entry, and if not, whether the matrix
A
should be equilibrated before it is factored.
If
fact
=
'F'
then, on entry,
af
and
ipiv
contain the factored form of
A
. If
equed
is not
'N'
, the matrix
A
has been equilibrated with scaling factors given by
r
and
c
. Arrays
a
,
af
, and
ipiv
are not modified.
If
fact
=
'N'
, the matrix
A
is copied to
af
and factored.
If
fact
=
'E'
, the matrix
A
is equilibrated if necessary, then copied to
af
and factored.
trans
(global) Must be
'N'
,
'T'
, or
'C'
.
Specifies the form of the system of equations:
If
trans
=
'N'
, the system has the form
A
*X
=
B
(No transpose);
If
trans
=
'T'
, the system has the form
A
T
*
X
=
B
(Transpose);
If
trans
=
'C'
, the system has the form
A
H
*X
=
B
(Conjugate transpose);
n
(global) The number of linear equations; the order of the submatrix
A
(
n
0)
.
nrhs
(global) The number of right hand sides; the number of columns of the distributed submatrices
B
and
X
(
nrhs
0)
.
a
,
af
,
b
,
work
(local)
Pointers into the local memory to arrays of local size
a
:
lld_a
*
LOCc
(
ja
+
n
-1)
,
af
:
lld_af
*
LOCc
(
ja
+
n
-1)
,
b
:
lld_b
*
LOCc
(
jb+nrhs-1
)
,
work
:
lwork
.
The array
a
contains the matrix
A
. If
fact
=
'F'
and
equed
is not
'N'
, then
A
must have been equilibrated by the scaling factors in
r
and/or
c
.
The array
af
is an input argument if
fact
=
'F'
. In this case it contains on entry the factored form of the matrix
A
, that is, the factors
L
and
U
from the factorization
A
=
P
*
L
*
U
as computed by
p?getrf
. If
equed
is not
'N'
, then
af
is the factored form of the equilibrated matrix
A
.
The array
b
contains on entry the matrix
B
whose columns are the right-hand sides for the systems of equations.
work
is a workspace array. The size of
work
is (
lwork
).
ia
,
ja
(global) The row and column indices in the global matrix
A
indicating the first row and the first column of the submatrix
A
(
ia:ia+n-1
,
ja:ja+n-1
)
, respectively.
desca
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
A
.
iaf
,
jaf
(global) The row and column indices in the global matrix
AF
indicating the first row and the first column of the subarray
af
, respectively.
descaf
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
AF
.
ib
,
jb
(global) The row and column indices in the global matrix
B
indicating the first row and the first column of the submatrix
B
(
ib:ib+n-1
,
jb:jb+nrhs-1
)
, respectively.
descb
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
B
.
ipiv
(local) Array of size
LOCr
(
m_a
)+
mb_a
.
The array
ipiv
is an input argument if
fact
=
'F'
.
On entry, it contains the pivot indices from the factorization
A
=
P
*
L
*
U
as computed by
p?getrf
; (local) row