LAPACK++
2022.05.00
LAPACK C++ API
|
Functions | |
int64_t | lapack::gesv (int64_t n, int64_t nrhs, double *A, int64_t lda, int64_t *ipiv, double *B, int64_t ldb) |
int64_t | lapack::gesv (int64_t n, int64_t nrhs, float *A, int64_t lda, int64_t *ipiv, float *B, int64_t ldb) |
int64_t | lapack::gesv (int64_t n, int64_t nrhs, std::complex< double > *A, int64_t lda, int64_t *ipiv, std::complex< double > *B, int64_t ldb) |
Computes the solution to a system of linear equations \(A X = B\), where A is an n-by-n matrix and X and B are n-by-nrhs matrices. More... | |
int64_t | lapack::gesv (int64_t n, int64_t nrhs, std::complex< float > *A, int64_t lda, int64_t *ipiv, std::complex< float > *B, int64_t ldb) |
int64_t | lapack::gesvx (lapack::Factored fact, lapack::Op trans, int64_t n, int64_t nrhs, double *A, int64_t lda, double *AF, int64_t ldaf, int64_t *ipiv, lapack::Equed *equed, double *R, double *C, double *B, int64_t ldb, double *X, int64_t ldx, double *rcond, double *ferr, double *berr, double *rpivotgrowth) |
int64_t | lapack::gesvx (lapack::Factored fact, lapack::Op trans, int64_t n, int64_t nrhs, float *A, int64_t lda, float *AF, int64_t ldaf, int64_t *ipiv, lapack::Equed *equed, float *R, float *C, float *B, int64_t ldb, float *X, int64_t ldx, float *rcond, float *ferr, float *berr, float *rpivotgrowth) |
int64_t | lapack::gesvx (lapack::Factored fact, lapack::Op trans, int64_t n, int64_t nrhs, std::complex< double > *A, int64_t lda, std::complex< double > *AF, int64_t ldaf, int64_t *ipiv, lapack::Equed *equed, double *R, double *C, std::complex< double > *B, int64_t ldb, std::complex< double > *X, int64_t ldx, double *rcond, double *ferr, double *berr, double *rpivotgrowth) |
Uses the LU factorization to compute the solution to a system of linear equations. More... | |
int64_t | lapack::gesvx (lapack::Factored fact, lapack::Op trans, int64_t n, int64_t nrhs, std::complex< float > *A, int64_t lda, std::complex< float > *AF, int64_t ldaf, int64_t *ipiv, lapack::Equed *equed, float *R, float *C, std::complex< float > *B, int64_t ldb, std::complex< float > *X, int64_t ldx, float *rcond, float *ferr, float *berr, float *rpivotgrowth) |
int64_t lapack::gesv | ( | int64_t | n, |
int64_t | nrhs, | ||
std::complex< double > * | A, | ||
int64_t | lda, | ||
int64_t * | ipiv, | ||
std::complex< double > * | B, | ||
int64_t | ldb | ||
) |
Computes the solution to a system of linear equations \(A X = B\), where A is an n-by-n matrix and X and B are n-by-nrhs matrices.
The LU decomposition with partial pivoting and row interchanges is used to factor A as \(A = P L U\), where P is a permutation matrix, L is unit lower triangular, and U is upper triangular. The factored form of A is then used to solve the system of equations \(A X = B\).
Overloaded versions are available for float
, double
, std::complex<float>
, and std::complex<double>
.
[in] | n | The number of linear equations, i.e., the order of the matrix A. n >= 0. |
[in] | nrhs | The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0. |
[in,out] | A | The n-by-n matrix A, stored in an lda-by-n array. On entry, the n-by-n coefficient matrix A. On exit, the factors L and U from the factorization \(A = P L U\); the unit diagonal elements of L are not stored. |
[in] | lda | The leading dimension of the array A. lda >= max(1,n). |
[out] | ipiv | The vector ipiv of length n. The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv(i). |
[in,out] | B | The n-by-nrhs matrix B, stored in an ldb-by-nrhs array. On entry, the n-by-nrhs matrix of right hand side matrix B. On successful exit, the n-by-nrhs solution matrix X. |
[in] | ldb | The leading dimension of the array B. ldb >= max(1,n). |
int64_t lapack::gesvx | ( | lapack::Factored | fact, |
lapack::Op | trans, | ||
int64_t | n, | ||
int64_t | nrhs, | ||
std::complex< double > * | A, | ||
int64_t | lda, | ||
std::complex< double > * | AF, | ||
int64_t | ldaf, | ||
int64_t * | ipiv, | ||
lapack::Equed * | equed, | ||
double * | R, | ||
double * | C, | ||
std::complex< double > * | B, | ||
int64_t | ldb, | ||
std::complex< double > * | X, | ||
int64_t | ldx, | ||
double * | rcond, | ||
double * | ferr, | ||
double * | berr, | ||
double * | rpivotgrowth | ||
) |
Uses the LU factorization to compute the solution to a system of linear equations.
\[ A X = B, \]
where A is an n-by-n matrix and X and B are n-by-nrhs matrices.
Error bounds on the solution and a condition estimate are also provided.
Overloaded versions are available for float
, double
, std::complex<float>
, and std::complex<double>
.
[in] | fact | Whether or not the factored form of the matrix A is supplied on entry, and if not, whether the matrix A should be equilibrated before it is factored.
|
[in] | trans | The form of the system of equations:
|
[in] | n | The number of linear equations, i.e., the order of the matrix A. n >= 0. |
[in] | nrhs | The number of right hand sides, i.e., the number of columns of the matrices B and X. nrhs >= 0. |
[in,out] | A | The n-by-n matrix A, stored in an lda-by-n array. On entry, the n-by-n matrix A.
|
[in] | lda | The leading dimension of the array A. lda >= max(1,n). |
[in,out] | AF | The n-by-n matrix AF, stored in an ldaf-by-n array.
|
[in] | ldaf | The leading dimension of the array AF. ldaf >= max(1,n). |
[in,out] | ipiv | The vector ipiv of length n.
|
[in,out] | equed | The form of equilibration that was done:
|
[in,out] | R | The vector R of length n. The row scale factors for A.
|
[in,out] | C | The vector C of length n. The column scale factors for A.
|
[in,out] | B | The n-by-nrhs matrix B, stored in an ldb-by-nrhs array. On entry, the n-by-nrhs right hand side matrix B. On exit,
|
[in] | ldb | The leading dimension of the array B. ldb >= max(1,n). |
[out] | X | The n-by-nrhs matrix X, stored in an ldx-by-nrhs array. If successful or return value = n+1, the n-by-nrhs solution matrix X to the original system of equations. Note that A and B are modified on exit if equed != None, and the solution to the equilibrated system is \(\text{diag}(C)^{-1} X\) if trans = NoTrans and equed = Col or Both, or \(\text{diag}(R)^{-1} X\) if trans = Trans or ConjTrans and equed = Row or Both. |
[in] | ldx | The leading dimension of the array X. ldx >= max(1,n). |
[out] | rcond | The estimate of the reciprocal condition number of the matrix A after equilibration (if done). If rcond is less than the machine precision (in particular, if rcond = 0), the matrix is singular to working precision. This condition is indicated by a return code of return value > 0. |
[out] | ferr | The vector ferr of length nrhs. The estimated forward error bound for each solution vector X(j) (the j-th column of the solution matrix X). If XTRUE is the true solution corresponding to X(j), ferr(j) is an estimated upper bound for the magnitude of the largest element in (X(j) - XTRUE) divided by the magnitude of the largest element in X(j). The estimate is as reliable as the estimate for rcond, and is almost always a slight overestimate of the true error. |
[out] | berr | The vector berr of length nrhs. The componentwise relative backward error of each solution vector X(j) (i.e., the smallest relative change in any element of A or B that makes X(j) an exact solution). |
[out] | rpivotgrowth | The reciprocal pivot growth factor norm(A)/norm(U). The "max absolute element" norm is used. If pivot growth is much less than 1, then the stability of the LU factorization of the (equilibrated) matrix A could be poor. This also means that the solution X, condition estimator rcond, and forward error bound ferr could be unreliable. If factorization fails with 0 < info <= n, then rpivotgrowth contains the reciprocal pivot growth factor for the leading info columns of A. |