?gbsvx
?gbsvx
Computes the solution to the real or complex system of linear equations with a band coefficient matrix A and multiple right-hand sides, and provides error bounds on the solution.
Syntax
lapack_int LAPACKE_sgbsvx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
kl
,
lapack_int
ku
,
lapack_int
nrhs
,
float*
ab
,
lapack_int
ldab
,
float*
afb
,
lapack_int
ldafb
,
lapack_int*
ipiv
,
char*
equed
,
float*
r
,
float*
c
,
float*
b
,
lapack_int
ldb
,
float*
x
,
lapack_int
ldx
,
float*
rcond
,
float*
ferr
,
float*
berr
,
float*
rpivot
);
lapack_int LAPACKE_dgbsvx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
kl
,
lapack_int
ku
,
lapack_int
nrhs
,
double*
ab
,
lapack_int
ldab
,
double*
afb
,
lapack_int
ldafb
,
lapack_int*
ipiv
,
char*
equed
,
double*
r
,
double*
c
,
double*
b
,
lapack_int
ldb
,
double*
x
,
lapack_int
ldx
,
double*
rcond
,
double*
ferr
,
double*
berr
,
double*
rpivot
);
lapack_int LAPACKE_cgbsvx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
kl
,
lapack_int
ku
,
lapack_int
nrhs
,
lapack_complex_float*
ab
,
lapack_int
ldab
,
lapack_complex_float*
afb
,
lapack_int
ldafb
,
lapack_int*
ipiv
,
char*
equed
,
float*
r
,
float*
c
,
lapack_complex_float*
b
,
lapack_int
ldb
,
lapack_complex_float*
x
,
lapack_int
ldx
,
float*
rcond
,
float*
ferr
,
float*
berr
,
float*
rpivot
);
lapack_int LAPACKE_zgbsvx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
kl
,
lapack_int
ku
,
lapack_int
nrhs
,
lapack_complex_double*
ab
,
lapack_int
ldab
,
lapack_complex_double*
afb
,
lapack_int
ldafb
,
lapack_int*
ipiv
,
char*
equed
,
double*
r
,
double*
c
,
lapack_complex_double*
b
,
lapack_int
ldb
,
lapack_complex_double*
x
,
lapack_int
ldx
,
double*
rcond
,
double*
ferr
,
double*
berr
,
double*
rpivot
);
Include Files
- mkl.h
Description
The routine uses the ,
LU
factorization to compute the solution to a real or complex system of linear equations A*X
= B
A
T
*X
= B
, or A
H
*X
= B
, where A
is a band matrix of order n
with kl
subdiagonals and ku
superdiagonals, the columns of matrix B
are individual right-hand sides, and the columns of X
are the corresponding solutions.Error bounds on the solution and a condition estimate are also provided.
The routine
?gbsvx
performs the following steps:- If, real scaling factorsfact='E'randcare computed to equilibrate the system::trans='N'diag(r)*A*diag(c) *inv(diag(c))*X=diag(r)*B:trans='T'(diag(r)*A*diag(c))*inv(Tdiag(r))*X=diag(c)*B:trans='C'(diag(r)*A*diag(c))*inv(Hdiag(r))*X=diag(c)*BWhether the system will be equilibrated depends on the scaling of the matrixA, but if equilibration is used,Ais overwritten byanddiag(r)*A*diag(c)(ifBbydiag(r)*Btrans='N') or(if ordiag(c)*B'C').
- Iforfact='N''E', theLUdecomposition is used to factor the matrixA(after equilibration if) asfact='E'A=L*U, whereLis a product of permutation and unit lower triangular matrices withklsubdiagonals, andUis upper triangular withkl+kusuperdiagonals.
- If some= 0, so thatUi,iUis exactly singular, then the routine returns with. Otherwise, the factored form ofinfo=iAis used to estimate the condition number of the matrixA. If the reciprocal of the condition number is less than machine precision,is returned as a warning, but the routine still goes on to solve forinfo=n+ 1Xand compute error bounds as described below.
- The system of equations is solved forXusing the factored form ofA.
- Iterative refinement is applied to improve the computed solution matrix and calculate error bounds and backward error estimates for it.
- If equilibration was used, the matrixXis premultiplied by(ifdiag(c)) ortrans='N'(ifdiag(r)ortrans='T''C') so that it solves the original system before equilibration.
Input Parameters
- matrix_layout
- Specifies whether matrix storage layout is row major (LAPACK_ROW_MAJOR) or column major (LAPACK_COL_MAJOR).
- fact
- Must be'F','N', or'E'.Specifies whether the factored form of the matrixAis supplied on entry, and if not, whether the matrixAshould be equilibrated before it is factored.If: on entry,fact='F'afbandipivcontain the factored form ofA. Ifequedis not'N', the matrixAis equilibrated with scaling factors given byrandc.ab,afb, andipivare not modified.If, the matrixfact='N'Awill be copied toafband factored.If, the matrixfact='E'Awill be equilibrated if necessary, then copied toafband factored.
- trans
- Must be'N','T', or'C'.Specifies the form of the system of equations:If, the system has the formtrans='N'(No transpose).A*X=BIf, the system has the formtrans='T'AT*X=B(Transpose).If, the system has the formtrans='C'AH*X=B(Transpose for real flavors, conjugate transpose for complex flavors).
- n
- The number of linear equations, the order of the matrixA;n≥0.
- kl
- The number of subdiagonals within the band ofA;kl≥0.
- ku
- The number of superdiagonals within the band ofA;ku≥0.
- nrhs
- The number of right hand sides, the number of columns of the matricesBandX;nrhs≥0.
- ab,afb,b
- Arrays:ab(max(,ldab*n))afb(max(,ldafb*n))b(max(1,.ldb*nrhs) for column major layout and max(1,ldb*n) for row major layout)The arrayabcontains the matrixAin band storage (see Matrix Storage Schemes). Ifandfact='F'equedis not'N', thenAmust have been equilibrated by the scaling factors inrand/orc.The arrayafbis an input argument if. It contains the factored form of the matrixfact='F'A, that is, the factorsLandUfrom the factorizationas computed byA=P*L*U?gbtrf.Uis stored as an upper triangular band matrix withkl+kusuperdiagonals.IfLis stored as lower triangular band matrix withklsubdiagonals.equedis not'N', thenafbis the factored form of the equilibrated matrixA.The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations.
- ldab
- The leading dimension ofab;ldab≥kl+ku+1.
- ldafb
- The leading dimension ofafb;ldafb≥2*kl+ku+1.
- ldb
- The leading dimension ofb;.ldb≥max(1,n) for column major layout andldb≥nrhsfor row major layout
- ipiv
- Array, size at leastmax(1,. The arrayn)ipivis an input argument if. It contains the pivot indices from the factorizationfact='F'as computed byA=P*L*U?gbtrf; rowiof the matrix was interchanged with row.ipiv[i-1]
- equed
- Must be'N','R','C', or'B'.equedis an input argument if. It specifies the form of equilibration that was done:fact='F'If, no equilibration was done (always true ifequed='N').fact='N'If, row equilibration was done, that is,equed='R'Ahas been premultiplied by.diag(r)If, column equilibration was done, that is,equed='C'Ahas been postmultiplied by.diag(c)if, both row and column equilibration was done, that is,equed='B'Ahas been replaced by.diag(r)*A*diag(c)
- r,c
- Arrays:r(sizen),.c(sizen)The arrayrcontains the row scale factors forA, and the arrayccontains the column scale factors forA. These arrays are input arguments ifonly; otherwise they are output arguments.fact='F'Iforequed='R''B',Ais multiplied on the left by; ifdiag(r)orequed='N''C',ris not accessed.Ifandfact='F'orequed='R''B', each element ofrmust be positive.Iforequed='C''B',Ais multiplied on the right by; ifdiag(c)orequed='N''R',cis not accessed.Ifandfact='F'orequed='C''B', each element ofcmust be positive.
- ldx
- The leading dimension of the output arrayx;.ldx≥max(1,n) for column major layout andldx≥nrhsfor row major layout
Output Parameters
- x
- Array, sizemax(1,.ldx*nrhs) for column major layout and max(1,ldx*n) for row major layoutIforinfo= 0, the arrayinfo=n+1xcontains the solution matrixXto theoriginalsystem of equations. Note thatAandBare modified on exit if, and the solution to the equilibrated system is:equed≠'N'inv(diag(