?tptrs
?tptrs
Solves a system of linear equations with a packed triangular coefficient matrix, with multiple right-hand sides.
Syntax
lapack_int
LAPACKE_stptrs
(
int
matrix_layout
,
char
uplo
,
char
trans
,
char
diag
,
lapack_int
n
,
lapack_int
nrhs
,
const
float
*
ap
,
float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_dtptrs
(
int
matrix_layout
,
char
uplo
,
char
trans
,
char
diag
,
lapack_int
n
,
lapack_int
nrhs
,
const
double
*
ap
,
double
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_ctptrs
(
int
matrix_layout
,
char
uplo
,
char
trans
,
char
diag
,
lapack_int
n
,
lapack_int
nrhs
,
const
lapack_complex_float
*
ap
,
lapack_complex_float
*
b
,
lapack_int
ldb
);
lapack_int
LAPACKE_ztptrs
(
int
matrix_layout
,
char
uplo
,
char
trans
,
char
diag
,
lapack_int
n
,
lapack_int
nrhs
,
const
lapack_complex_double
*
ap
,
lapack_complex_double
*
b
,
lapack_int
ldb
);
Include Files
- mkl.h
Description
The routine solves for
X
the following systems of linear equations with a packed triangular matrix A
, with multiple right-hand sides stored in B
:- A*X=B
- iftrans='N',
- AT*X=B
- iftrans='T',
- AH*X=B
- iftrans='C'(for complex matrices only).
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 whetherAis upper or lower triangular:If, thenuplo='U'Ais upper triangular.If, thenuplo='L'Ais lower triangular.
- trans
- Must be'N'or'T'or'C'.If, thentrans='N'is solved forA*X=BX.If, thentrans='T'AT*X=Bis solved forX.If, thentrans='C'AH*X=Bis solved forX.
- diag
- Must be'N'or'U'.If, thendiag='N'Ais not a unit triangular matrix.If, thendiag='U'Ais unit triangular: diagonal elements are assumed to be 1 and not referenced in the arrayap.
- n
- The order ofA; the number of rows inB;n≥0.
- nrhs
- The number of right-hand sides;nrhs≥0.
- ap
- The dimension of arraymust be at least max(1,apn(n+1)/2). The arrayapcontains the matrixAin packed storage (see Matrix Storage Schemes).
- b
- The arraycontains the matrixbBwhose columns are the right-hand sides for the system of equations.The size ofbis 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 , parameter
info
= -i
i
had an illegal value.Application Notes
For each right-hand side
b
, the computed solution is the exact solution of a perturbed system of equations (
, where A
+ E
)x
= b
|E| ≤ c(n)ε |A|
c
(n
)n
, and ε
is the machine precision.If is the true solution, the computed solution
x
0
x
satisfies this error bound:
where / || || = (
cond(
= || |A
,x
)A
-1
||A
| |x
| ||∞
x
||∞
≤
||A
-1
||∞
A
||∞
κ
∞
A
).Note that (; the condition number of and might or might not be equal to (.
cond(
can be much smaller than A
,x
)κ
∞
A
)A
T
A
H
κ
∞
A
)The approximate number of floating-point operations for one right-hand side vector
b
is n
2
for real flavors and 4
for complex flavors.n
2
To estimate the condition number (, call
κ
∞
A
)?tpcon
. To estimate the error in the solution, call
?tprfs
.