?potrs
?potrs
Solves a system of linear equations with a Cholesky-factored symmetric (Hermitian) positive-definite coefficient matrix.
Syntax
lapack_int
LAPACKE_spotrs
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const
float
*
a
,
lapack_int
lda
,
float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_dpotrs
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const
double
*
a
,
lapack_int
lda
,
double
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_cpotrs
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const
lapack_complex_float
*
a
,
lapack_int
lda
,
lapack_complex_float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_zpotrs
(
int
matrix_layout
,
char
uplo
,
lapack_int
n
,
lapack_int
nrhs
,
const
lapack_complex_double
*
a
,
lapack_int
lda
,
lapack_complex_double
*
b
,
lapack_int
ldb
);
Include Files
- mkl.h
Description
The routine solves for with a symmetric positive-definite or, for complex data, Hermitian positive-definite matrix
X
the system of linear equations A*X
= B
A
, given the Cholesky factorization of A
:A = U T *U A = U H *U | if uplo ='U' |
A = L*L T A = L*L H | if uplo ='L' |
where
L
is a lower triangular matrix and U
is upper triangular. The system is solved with multiple right-hand sides stored in the columns of the matrix B
.Before calling this routine, you must call ?potrf to compute the Cholesky factorization of
A
.Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- uplo
- Must be'U'or'L'.Indicates how the input matrixAhas been factored:If,uplo='U'Uis stored, whereA=UT*Ufor real data,A=UH*Ufor complex data.If,uplo='L'Lis stored, whereA=L*LTfor real data,A=L*LHfor complex data.
- n
- The order of matrixA;n≥0.
- nrhs
- The number of right-hand sides(.nrhs≥0)
- a
- ArrayAof size at least max(1,lda*n)
- lda
- The leading dimension ofa.lda≥max(1,n).
- b
- The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations. The size ofbmust be at least max(1,ldb*nrhs) for column major layout and max(1,ldb*n) for row major layout.
- ldb
- The leading dimension ofb.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout.
Output Parameters
- b
- Overwritten by the solution matrixX.
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If
info
= -i
, parameter i
had an illegal value.Application Notes
If , the computed solution for each right-hand side
uplo
= 'U'
b
is the exact solution of a perturbed system of equations (
, where A
+ E
)x
= b
|E| ≤ c(n)ε |UH||U|
c
(n
)n
, and ε
is the machine precision. A similar estimate holds for . If is the true solution, the computed solution
uplo
= 'L'
x
0
x
satisfies this error bound: 
where / || || = (
cond(
= || |A
,x
)A
-1
||A
| |x
| ||∞
x
||∞
≤
||A
-1
||∞
A
||∞
κ
∞
A
).Note that (
cond(
can be much smaller than A
,x
)κ
∞
A
). The approximate number of floating-point operations for one right-hand side vector b
is 2
for real flavors and n
2
8
for complex flavors.n
2
To estimate the condition number (, call
κ
∞
A
)?pocon
. To refine the solution and estimate the error, call
?porfs
.