?gtrfs
?gtrfs
Refines the solution of a system of linear equations with a tridiagonal coefficient matrix and estimates its error.
Syntax
lapack_int LAPACKE_sgtrfs
(
int
matrix_layout
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
const float*
dl
,
const float*
d
,
const float*
du
,
const float*
dlf
,
const float*
df
,
const float*
duf
,
const float*
du2
,
const lapack_int*
ipiv
,
const float*
b
,
lapack_int
ldb
,
float*
x
,
lapack_int
ldx
,
float*
ferr
,
float*
berr
);
lapack_int LAPACKE_dgtrfs
(
int
matrix_layout
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
const double*
dl
,
const double*
d
,
const double*
du
,
const double*
dlf
,
const double*
df
,
const double*
duf
,
const double*
du2
,
const lapack_int*
ipiv
,
const double*
b
,
lapack_int
ldb
,
double*
x
,
lapack_int
ldx
,
double*
ferr
,
double*
berr
);
lapack_int LAPACKE_cgtrfs
(
int
matrix_layout
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_float*
dl
,
const lapack_complex_float*
d
,
const lapack_complex_float*
du
,
const lapack_complex_float*
dlf
,
const lapack_complex_float*
df
,
const lapack_complex_float*
duf
,
const lapack_complex_float*
du2
,
const lapack_int*
ipiv
,
const lapack_complex_float*
b
,
lapack_int
ldb
,
lapack_complex_float*
x
,
lapack_int
ldx
,
float*
ferr
,
float*
berr
);
lapack_int LAPACKE_zgtrfs
(
int
matrix_layout
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
const lapack_complex_double*
dl
,
const lapack_complex_double*
d
,
const lapack_complex_double*
du
,
const lapack_complex_double*
dlf
,
const lapack_complex_double*
df
,
const lapack_complex_double*
duf
,
const lapack_complex_double*
du2
,
const lapack_int*
ipiv
,
const lapack_complex_double*
b
,
lapack_int
ldb
,
lapack_complex_double*
x
,
lapack_int
ldx
,
double*
ferr
,
double*
berr
);
Include Files
- mkl.h
Description
The routine performs an iterative refinement of the solution to a system of linear equations or or
A*X
= B
A
T
*X
= B
A
H
*X
= B
with a tridiagonal matrix A
, with multiple right-hand sides. For each computed solution vector x
, the routine computes the component-wise backward errorβ
. This error is the smallest relative perturbation in elements of A
and b
such that x
is the exact solution of the perturbed system:||/|| |, ||/|| |
such that δ
a
i
j
a
i
j
≤
β
|a
i
j
δ
b
i
b
i
≤
β
|b
i
(
.A
+ δ
A
)x
= (b
+ δ
b
)Finally, the routine estimates the component-wise forward error in the computed solution is the exact solution).
||||/||
(here x
- x
e
∞
x
||∞
x
e
Before calling this routine:
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- trans
- Must be'N'or'T'or'C'.Indicates the form of the equations:If, the system has the formtrans='N'.A*X=BIf, the system has the formtrans='T'AT*X=B.If, the system has the formtrans='C'AH*X=B.
- n
- The order of the matrixA;n≥0.
- nrhs
- The number of right-hand sides, that is, the number of columns of the matrixB;nrhs≥0.
- dl
- Arraydlof sizen-1 contains the subdiagonal elements ofA.
- d
- Arraydof sizencontains the diagonal elements ofA.
- du
- Arrayduof sizen-1 contains the superdiagonal elements ofA.
- dlf
- Arraydlfof sizen-1 contains the (n- 1) multipliers that define the matrixLfrom theLUfactorization ofAas computed by?gttrf.
- df
- Arraydfof sizencontains thendiagonal elements of the upper triangular matrixUfrom theLUfactorization ofA.
- duf
- Arraydufof sizen-1 contains the (n- 1) elements of the first superdiagonal ofU.
- du2
- Arraydu2of sizen-2 contains the (n- 2) elements of the second superdiagonal ofU.
- b
- Arrayb(size max(1,ldb*nrhs) for column major layout and max(1,ldb*n) for row major layout) contains the right-hand side matrixB.
- x
- Arrayx(size max(1,ldx*nrhs) for column major layout and max(1,ldx*n) contains the solution matrixX, as computed by?gttrs.
- ldb
- The leading dimension ofb;.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout
- ldx
- The leading dimension ofx;.ldx≥max(1,n) for column major layout andldx≥nrhsfor row major layout
- ipiv
Output Parameters
- x
- The refined solution matrixX.
- ferr,berr
- Arrays, size at leastmax(1,. Contain the component-wise forward and backward errors, respectively, for each solution vector.nrhs)
Return Values
This function returns a value
info
.If , the execution is successful.
info
= 0If
info
= -i
, parameter i
had an illegal value.