Contents

# p?posvx

Solves a symmetric or Hermitian positive definite system of linear equations.

## Syntax

Include Files
• mkl_scalapack.h
Description
The
p?posvx
function
uses the Cholesky factorization
A
=
U
T
*U
or
A
=
L*L
T
to compute the solution to a real or complex system of linear equations
A
(
ia
:
ia
+
n
-1,
ja
:
ja
+
n
-1)*
X
=
B
(
ib
:
ib
+
n
-1,
jb
:
jb
+
nrhs
-1)
,
where
A
(
ia
:
ia
+
n
-1,
ja
:
ja
+
n
-1)
is a
n
-by-
n
matrix and
X
and
B
(
ib
:
ib
+
n
-1,
jb
:
jb
+
nrhs
-1)
are
n
-by-
nrhs
matrices.
Error bounds on the solution and a condition estimate are also provided.
y
denotes
Y
(
iy
:
iy
+
m
-1,
jy
:
jy
+
k
-1)
, an
m
-by-
k
matrix where
y
can be
a
,
af
,
b
and
x
.
The
function
p?posvx
performs the following steps:
1. If
fact
=
'E'
, real scaling factors
s
are computed to equilibrate the system:
diag(
sr
)*
A
*diag(
sc
)*inv(diag(
sc
))*
X
= diag(
sr
)*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(
sr
)*
A
*diag(
sc
)
and
B
by
diag(
sr
)*
B
.
2. If
fact
=
'N'
or
'E'
, the Cholesky decomposition is used to factor the matrix
A
(after equilibration if
fact
=
'E'
) as
A
=
U
T
*U
, if
uplo
=
'U'
, or
A
=
L*L
T
, if
uplo
=
'L'
,
where
U
is an upper triangular matrix and
L
is a lower triangular matrix.
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 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(
sr
) 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'
: on entry,
af
contains the factored form of
A
. If
equed
=
'Y'
, the matrix
A
has been equilibrated with scaling factors given by
s
.
a
and
af
will not be modified.
If
fact
=
'N'
, the matrix
A
will be copied to
af
and factored.
If
fact
=
'E'
, the matrix
A
will be equilibrated if necessary, then copied to
af
and factored.
uplo
(global) Must be
'U'
or
'L'
.
Indicates whether the upper or lower triangular part of
A
is stored.
n
(global) The order of the distributed matrix sub(
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
(local)
Pointer into the local memory to an array of local size
lld_a
*
LOCc
(
ja
+
n
-1)
. On entry, the symmetric/Hermitian matrix
A
, except if
fact
=
'F'
and
equed
=
'Y'
, then
A
must contain the equilibrated matrix
diag(
sr
)*
A
*diag(
sc
)
.
If
uplo
=
'U'
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'
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.
A
is not modified if
fact
=
'F'
or
'N'
, or if
fact
=
'E'
and
equed
=
'N'
on exit.
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
, respectively.
desca
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
A
.
af
(local)
Pointer into the local memory to an array of local size
lld_af
*
LOCc
(
ja
+
n
-1)
.
If
fact
=
'F'
, then
af
is an input argument and on entry contains the triangular factor
U
or
L
from the Cholesky factorization
A
=
U
T
*
U
or
A
=
L
*
L
T
, in the same storage format as
A
. If
equed
'N'
, then
af
is the factored form of the equilibrated matrix
diag(
sr
)*
A
*diag(
sc
)
.
iaf
,
jaf
(global) The row and column indices in the global matrix
AF
indicating the first row and the first column of the submatrix
AF
, respectively.
descaf
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
AF
.
equed
(global) Must be
'N'
or
'Y'
.
equed
is an input argument if
fact
=
'F'
. It specifies the form of equilibration that was done:
If
equed
=
'N'
, no equilibration was done (always true if
fact
=
'N'
);
If
equed
=
'Y'
, equilibration was done and
A
has been replaced by
diag(
sr
)*
A
*diag(
sc
)
.
sr
(local)
Array of size
lld_a
.
The array
s
contains the scale factors for
A
. This array is an input argument if
fact
=
'F'
only; otherwise it is an output argument.
If
equed
=
'N'
,
s
is not accessed.
If
fact
=
'F'
and
equed
=
'Y'
, each element of
s
must be positive.
b
(local)
Pointer into the local memory to an array of local size
lld_b
*
LOCc
(
jb
+
nrhs
-1)
. On entry, the
n
-by-
nrhs
right-hand side matrix
B
.
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
, respectively.
descb
(global and local) Array of size
dlen_
. The array descriptor for the distributed matrix
B
.
x
(local)
Pointer into the local memory to an array of local size
lld_x
*
LOCc
(
jx
+
nrhs
-1)
.
ix
,
jx
(global) The row and column indices in the global matrix
X
indicating the first row and the first column of the submatrix
X
, respectively.
descx
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
X
.
work
(local)
Workspace array of size
lwork
.
lwork
(local or global)
The size of the array
work
.
lwork
is local input and must be at least
lwork
=
max
(
p?pocon
(
lwork
),
p?porfs
(
lwork
)) +
LOCr
(
n_a
)
.
lwork
= 3*