?gesvxx
?gesvxx
Uses extra precise iterative refinement to compute the solution to the system of linear equations with a square coefficient matrix A and multiple right-hand sides
Syntax
lapack_int LAPACKE_sgesvxx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
float*
a
,
lapack_int
lda
,
float*
af
,
lapack_int
ldaf
,
lapack_int*
ipiv
,
char*
equed
,
float*
r
,
float*
c
,
float*
b
,
lapack_int
ldb
,
float*
x
,
lapack_int
ldx
,
float*
rcond
,
float*
rpvgrw
,
float*
berr
,
lapack_int
n_err_bnds
,
float*
err_bnds_norm
,
float*
err_bnds_comp
,
lapack_int
nparams
,
const float*
params
);
lapack_int LAPACKE_dgesvxx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
double*
a
,
lapack_int
lda
,
double*
af
,
lapack_int
ldaf
,
lapack_int*
ipiv
,
char*
equed
,
double*
r
,
double*
c
,
double*
b
,
lapack_int
ldb
,
double*
x
,
lapack_int
ldx
,
double*
rcond
,
double*
rpvgrw
,
double*
berr
,
lapack_int
n_err_bnds
,
double*
err_bnds_norm
,
double*
err_bnds_comp
,
lapack_int
nparams
,
const double*
params
);
lapack_int LAPACKE_cgesvxx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
lapack_complex_float*
a
,
lapack_int
lda
,
lapack_complex_float*
af
,
lapack_int
ldaf
,
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*
rpvgrw
,
float*
berr
,
lapack_int
n_err_bnds
,
float*
err_bnds_norm
,
float*
err_bnds_comp
,
lapack_int
nparams
,
const float*
params
);
lapack_int LAPACKE_zgesvxx
(
int
matrix_layout
,
char
fact
,
char
trans
,
lapack_int
n
,
lapack_int
nrhs
,
lapack_complex_double*
a
,
lapack_int
lda
,
lapack_complex_double*
af
,
lapack_int
ldaf
,
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*
rpvgrw
,
double*
berr
,
lapack_int
n_err_bnds
,
double*
err_bnds_norm
,
double*
err_bnds_comp
,
lapack_int
nparams
,
const double*
params
);
Include Files
- mkl.h
Description
The routine uses the LU factorization to compute the solution to a real or complex system of linear equations , where
A*X
= B
A
is an n
-by-n
matrix, the columns of the matrix B
are individual right-hand sides, and the columns of X
are the corresponding solutions.Both normwise and maximum componentwise error bounds are also provided on request. The routine returns a solution with a small guaranteed error (
O(eps)
, where eps
is the working machine precision) unless the matrix is very ill-conditioned, in which case a warning is returned. Relevant condition numbers are also calculated and returned.The routine accepts user-provided factorizations and equilibration factors; see definitions of the
fact
and equed
options. Solving with refinement and using a factorization from a previous call of the routine also produces a solution with O(eps)
errors or warnings but that may not be true for general user-provided factorizations and equilibration factors if they differ from what the routine would itself produce.The routine
?gesvxx
performs the following steps:- If, 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 or not the system will be equilibrated depends on the scaling of the matrixA, but if equilibration is used,Ais overwritten byanddiag(r)*A*diag(c)Bby(ifdiag(r)*Bortrans='N')(ifdiag(c)*Bortrans='T').'C'
- Iforfact='N', the'E'LUdecomposition is used to factor the matrixA(after equilibration if) asfact='E', whereA=P*L*UPis a permutation matrix,Lis a unit lower triangular matrix, andUis upper triangular.
- 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(see thercondparameter). If the reciprocal of the condition number is less than machine precision, the routine still goes on to solve forXand compute error bounds.
- The system of equations is solved forXusing the factored form ofA.
- By default, unless is set to zero, the routine applies iterative refinement to improve the computed solution matrix and calculate error bounds. Refinement calculates the residual to at least twice the working precision.
- If equilibration was used, the matrixXis premultiplied by(ifdiag(c)) ortrans='N'(ifdiag(r)ortrans='T') so that it solves the original system before equilibration.'C'
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 or not 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'afandipivcontain the factored form ofA. Ifequedis not'N', the matrixAhas been equilibrated with scaling factors given byrandc. Parametersa,af, andipivare not modified.If, the matrixfact='N'Awill be copied toafand factored.If, the matrixfact='E'Awill be equilibrated, if necessary, copied toafand 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(Conjugate Transpose = Transpose for real flavors, Conjugate Transpose for complex flavors).
- n
- The number of linear equations; the order of the matrixA;n≥0.
- nrhs
- The number of right hand sides; the number of columns of the matricesBandX;nrhs≥0.
- a,af,b
- Arrays:a(size max(,lda*n))af(size max(,ldaf*n))b(size max(1,.ldb*nrhs) for column major layout and max(1,ldb*n) for row major layout)The arrayacontains the matrixA. Ifandfact='F'equedis not'N', thenAmust have been equilibrated by the scaling factors inrand/orc. .The arrayafis 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?getrf. Ifequedis not'N', thenafis the factored form of the equilibrated matrixA.The arraybcontains the matrixBwhose columns are the right-hand sides for the systems of equations.
- lda
- The leading dimension ofa;.lda≥max(1,n)
- ldaf
- The leading dimension ofaf;.ldaf≥max(1,n)
- 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?getrf; 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 bydiag(r).If, column equilibration was done, that is,equed='C'Ahas been postmultiplied bydiag(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),. The arrayc(sizen)rcontains 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 bydiag(r); iforequed='N''C',ris not accessed.Ifandfact='F'orequed='R''B', each element ofrmust be positive.Iforequed='C''B',Ais multiplied on the right bydiag(c); iforequed='N''R',cis not accessed.Ifandfact='F'orequed='C''B', each element ofcmust be positive.Each element ofrorcshould be a power of the radix to ensure a reliable solution and error estimates. Scaling by powers of the radix does not cause rounding errors unless the result underflows or overflows. Rounding errors during scaling lead to refining with a matrix that is not equivalent to the input matrix, producing error estimates that may not be reliable.
- ldb