LAPACK++
LAPACK C++ API
|
Functions | |
int64_t | lapack::ppsv (lapack::Uplo uplo, int64_t n, int64_t nrhs, double *AP, double *B, int64_t ldb) |
int64_t | lapack::ppsv (lapack::Uplo uplo, int64_t n, int64_t nrhs, float *AP, float *B, int64_t ldb) |
int64_t | lapack::ppsv (lapack::Uplo uplo, int64_t n, int64_t nrhs, std::complex< double > *AP, std::complex< double > *B, int64_t ldb) |
Computes the solution to a system of linear equations. More... | |
int64_t | lapack::ppsv (lapack::Uplo uplo, int64_t n, int64_t nrhs, std::complex< float > *AP, std::complex< float > *B, int64_t ldb) |
int64_t | lapack::ppsvx (lapack::Factored fact, lapack::Uplo uplo, int64_t n, int64_t nrhs, double *AP, double *AFP, lapack::Equed *equed, double *S, double *B, int64_t ldb, double *X, int64_t ldx, double *rcond, double *ferr, double *berr) |
int64_t | lapack::ppsvx (lapack::Factored fact, lapack::Uplo uplo, int64_t n, int64_t nrhs, float *AP, float *AFP, lapack::Equed *equed, float *S, float *B, int64_t ldb, float *X, int64_t ldx, float *rcond, float *ferr, float *berr) |
int64_t | lapack::ppsvx (lapack::Factored fact, lapack::Uplo uplo, int64_t n, int64_t nrhs, std::complex< double > *AP, std::complex< double > *AFP, lapack::Equed *equed, double *S, std::complex< double > *B, int64_t ldb, std::complex< double > *X, int64_t ldx, double *rcond, double *ferr, double *berr) |
Uses the Cholesky factorization \(A = U^H U\) or \(A = L L^H\) to compute the solution to a system of linear equations. More... | |
int64_t | lapack::ppsvx (lapack::Factored fact, lapack::Uplo uplo, int64_t n, int64_t nrhs, std::complex< float > *AP, std::complex< float > *AFP, lapack::Equed *equed, float *S, std::complex< float > *B, int64_t ldb, std::complex< float > *X, int64_t ldx, float *rcond, float *ferr, float *berr) |
int64_t lapack::ppsv | ( | lapack::Uplo | uplo, |
int64_t | n, | ||
int64_t | nrhs, | ||
std::complex< double > * | AP, | ||
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 Hermitian positive definite matrix stored in packed format and X and B are n-by-nrhs matrices.
The Cholesky decomposition is used to factor A as \(A = U^H U\) if uplo = Upper, or \(A = L L^H\) if uplo = Lower, where U is an upper triangular matrix and L is a lower triangular matrix. 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] | uplo |
|
[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] | AP | The vector AP of length n*(n+1)/2.
|
[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 successful exit, the n-by-nrhs solution matrix X. |
[in] | ldb | The leading dimension of the array B. ldb >= max(1,n). |
The packed storage scheme is illustrated by the following example when n = 4, uplo = Upper:
Two-dimensional storage of the Hermitian matrix A:
[ a11 a12 a13 a14 ] [ a22 a23 a24 ] [ a33 a34 ] (aij = conj(aji)) [ a44 ]
Packed storage of the upper triangle of A:
AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]
int64_t lapack::ppsvx | ( | lapack::Factored | fact, |
lapack::Uplo | uplo, | ||
int64_t | n, | ||
int64_t | nrhs, | ||
std::complex< double > * | AP, | ||
std::complex< double > * | AFP, | ||
lapack::Equed * | equed, | ||
double * | S, | ||
std::complex< double > * | B, | ||
int64_t | ldb, | ||
std::complex< double > * | X, | ||
int64_t | ldx, | ||
double * | rcond, | ||
double * | ferr, | ||
double * | berr | ||
) |
Uses the Cholesky factorization \(A = U^H U\) or \(A = L L^H\) to compute the solution to a system of linear equations.
\[ A X = B, \]
where A is an n-by-n Hermitian positive definite matrix stored in packed format 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] | uplo |
|
[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] | AP | The vector AP of length n*(n+1)/2.
|
[in,out] | AFP | The vector AFP of length n*(n+1)/2.
|
[in,out] | equed | The form of equilibration that was done:
|
[in,out] | S | The vector S of length n. The 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, if equed = None, B is not modified; if equed = Yes, B is overwritten by \(\text{diag}(S) \; B.\) |
[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 if equed = Yes, A and B are modified on exit, and the solution to the equilibrated system is \(\text{diag}(S)^{-1} X.\) |
[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). |
The packed storage scheme is illustrated by the following example when n = 4, uplo = Upper:
Two-dimensional storage of the Hermitian matrix A:
[ a11 a12 a13 a14 ] [ a22 a23 a24 ] [ a33 a34 ] (aij = conj(aji)) [ a44 ]
Packed storage of the upper triangle of A:
AP = [ a11, a12, a22, a13, a23, a33, a14, a24, a34, a44 ]