Forward/Backward Substitution

LAPACK LU-based substitution functions (getrs)

void blaze::getrs (char trans, int n, int nrhs, const float *A, int lda, const int *ipiv, float *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a general single precision linear system of equations ( $ A*X=B $). More...
 
void blaze::getrs (char trans, int n, int nrhs, const double *A, int lda, const int *ipiv, double *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a general double precision linear system of equations ( $ A*X=B $). More...
 
void blaze::getrs (char trans, int n, int nrhs, const complex< float > *A, int lda, const int *ipiv, complex< float > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a general single precision complex linear system of equations ( $ A*X=B $). More...
 
void blaze::getrs (char trans, int n, int nrhs, const complex< double > *A, int lda, const int *ipiv, complex< double > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a general double precision complex linear system of equations ( $ A*X=B $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
void blaze::getrs (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &b, char trans, const int *ipiv)
 LAPACK kernel for the substitution step of solving a general linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::getrs (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char trans, const int *ipiv)
 LAPACK kernel for the substitution step of solving a general linear system of equations ( $ A*X=B $). More...
 

LAPACK LDLH-based substitution functions (hetrs)

void blaze::hetrs (char uplo, int n, int nrhs, const complex< float > *A, int lda, const int *ipiv, complex< float > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite single precision complex linear system of equations ( $ A*X=B $). More...
 
void blaze::hetrs (char uplo, int n, int nrhs, const complex< double > *A, int lda, const int *ipiv, complex< double > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite double precision complex linear system of equations ( $ A*X=B $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
void blaze::hetrs (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &b, char uplo, const int *ipiv)
 LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::hetrs (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, const int *ipiv)
 LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*X=B $). More...
 

LAPACK LLH-based substitution functions (potrs)

void blaze::potrs (char uplo, int n, int nrhs, const float *A, int lda, float *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a positive definite single precision linear system of equations ( $ A*X=B $). More...
 
void blaze::potrs (char uplo, int n, int nrhs, const double *A, int lda, double *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a positive definite double precision linear system of equations ( $ A*X=B $). More...
 
void blaze::potrs (char uplo, int n, int nrhs, const complex< float > *A, int lda, complex< float > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a positive definite single precision complex linear system of equations ( $ A*X=B $). More...
 
void blaze::potrs (char uplo, int n, int nrhs, const complex< double > *A, int lda, complex< double > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a positive definite double precision complex linear system of equations ( $ A*X=B $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
void blaze::potrs (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &b, char uplo)
 LAPACK kernel for the substitution step of solving a positive definite linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::potrs (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo)
 LAPACK kernel for the substitution step of solving a positive definite linear system of equations ( $ A*X=B $). More...
 

LAPACK LDLT-based substitution functions (sytrs)

void blaze::sytrs (char uplo, int n, int nrhs, const float *A, int lda, const int *ipiv, float *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite single precision linear system of equations ( $ A*X=B $). More...
 
void blaze::sytrs (char uplo, int n, int nrhs, const double *A, int lda, const int *ipiv, double *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite double precision linear system of equations ( $ A*X=B $). More...
 
void blaze::sytrs (char uplo, int n, int nrhs, const complex< float > *A, int lda, const int *ipiv, complex< float > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite single precision complex linear system of equations ( $ A*X=B $). More...
 
void blaze::sytrs (char uplo, int n, int nrhs, const complex< double > *A, int lda, const int *ipiv, complex< double > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a symmetric indefinite double precision complex linear system of equations ( $ A*X=B $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
void blaze::sytrs (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &b, char uplo, const int *ipiv)
 LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::sytrs (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, const int *ipiv)
 LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*X=B $). More...
 

LAPACK triangular substitution functions (trtrs)

void blaze::trtrs (char uplo, char trans, char diag, int n, int nrhs, const float *A, int lda, float *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a triangular single precision linear system of equations ( $ A*X=B $). More...
 
void blaze::trtrs (char uplo, char trans, char diag, int n, int nrhs, const double *A, int lda, double *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a triangular double precision linear system of equations ( $ A*X=B $). More...
 
void blaze::trtrs (char uplo, char trans, char diag, int n, int nrhs, const complex< float > *A, int lda, complex< float > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a triangular single precision complex linear system of equations ( $ A*X=B $). More...
 
void blaze::trtrs (char uplo, char trans, char diag, int n, int nrhs, const complex< double > *A, int lda, complex< double > *B, int ldb, int *info)
 LAPACK kernel for the substitution step of solving a triangular double precision complex linear system of equations ( $ A*X=B $). More...
 
template<typename MT , bool SO, typename VT , bool TF>
void blaze::trtrs (const DenseMatrix< MT, SO > &A, DenseVector< VT, TF > &b, char uplo, char trans, char diag)
 LAPACK kernel for the substitution step of solving a triangular linear system of equations ( $ A*x=b $). More...
 
template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::trtrs (const DenseMatrix< MT1, SO1 > &A, DenseMatrix< MT2, SO2 > &B, char uplo, char trans, char diag)
 LAPACK kernel for the substitution step of solving a triangular linear system of equations ( $ A*X=B $). More...
 

Detailed Description

Function Documentation

◆ getrs() [1/6]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::getrs ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  b,
char  trans,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a general linear system of equations ( $ A*x=b $).

Parameters
AThe system matrix.
bThe right-hand side vector.
trans'N' for $ A*x=b $, 'T' for $ A^T*x=b $, and C for $ A^H*x=b $.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::invalid_argumentInvalid trans argument provided.

This function uses the LAPACK getrs() functions to perform the substitution step to compute the solution to the general system of linear equations:

  • $ A *x=b $ if A is column-major
  • $ A^T*x=b $ if A is row-major

In this context the general system matrix A is a n-by-n matrix that has already been factorized by the getrf() functions and x and b are n-dimensional vectors. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the vector b contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given trans argument is neither 'N' nor 'T' nor 'C'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
getrf( D, ipiv.data() );
getrs( D, x, 'N', ipiv.data() );
assert( A * x == b );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
getrf( D, ipiv.data() );
getrs( D, x, 'N', ipiv.data() );
assert( trans( A ) * x == b );

For more information on the getrs() functions (i.e. sgetrs(), dgetrs(), cgetrs(), and zgetrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ getrs() [2/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::getrs ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  B,
char  trans,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a general linear system of equations ( $ A*X=B $).

Parameters
AThe system matrix.
BThe matrix of right-hand sides.
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::invalid_argumentInvalid trans argument provided.

This function uses the LAPACK getrs() functions to perform the substitution step to compute the solution to the general system of linear equations:

  • $ A *X =B $ if both A and B are column-major
  • $ A^T*X =B $ if A is row-major and B is column-major
  • $ A *X^T=B^T $ if A is column-major and B is row-major
  • $ A^T*X^T=B^T $ if both A and B are row-major

In this context the general system matrix A is a n-by-n matrix that has already been factorized by the getrf() functions and X and B are either row-major m-by-n matrices or column-major n-by-m matrices. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the matrix B contains the solutions of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given trans argument is neither 'N' nor 'T' nor 'C'.
  • ... the sizes of the two given matrices do not match.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,columnMajor> B( 2UL, 4UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,columnMajor> X( B ); // Temporary matrix for the solution
getrf( D, ipiv.data() );
getrs( D, X, 'N', ipiv.data() );
assert( A * X == B );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,rowMajor> B( 2UL, 4UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,rowMajor> X( B ); // Temporary matrix for the solution
getrf( D, ipiv.data() );
getrs( D, X, 'N', ipiv.data() );
assert( trans( A ) * trans( X ) == trans( B ) );

For more information on the getrs() functions (i.e. sgetrs(), dgetrs(), cgetrs(), and zgetrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ getrs() [3/6]

void blaze::getrs ( char  trans,
int  n,
int  nrhs,
const float *  A,
int  lda,
const int *  ipiv,
float *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a general single precision linear system of equations ( $ A*X=B $).

Parameters
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK sgetrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix that has already been factorized by the sgetrf() function and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the sgetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ getrs() [4/6]

void blaze::getrs ( char  trans,
int  n,
int  nrhs,
const double *  A,
int  lda,
const int *  ipiv,
double *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a general double precision linear system of equations ( $ A*X=B $).

Parameters
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK dgetrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix that has already been factorized by the dgetrf() function and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the dgetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ getrs() [5/6]

void blaze::getrs ( char  trans,
int  n,
int  nrhs,
const complex< float > *  A,
int  lda,
const int *  ipiv,
complex< float > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a general single precision complex linear system of equations ( $ A*X=B $).

Parameters
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision complex column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK cgetrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix that has already been factorized by the cgetrf() function and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the cgetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ getrs() [6/6]

void blaze::getrs ( char  trans,
int  n,
int  nrhs,
const complex< double > *  A,
int  lda,
const int *  ipiv,
complex< double > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a general double precision complex linear system of equations ( $ A*X=B $).

Parameters
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision complex column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK zgetrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix that has already been factorized by the zgetrf() function and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the zgetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ hetrs() [1/4]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::hetrs ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  b,
char  uplo,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*x=b $).

Parameters
AThe system matrix.
bThe right-hand side vector.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK hetrs() functions to perform the substitution step to compute the solution to the system of symmetric indefinite linear equations:

  • $ A *x=b $ if A is column-major
  • $ A^T*x=b $ if A is row-major

In this context the symmetric indefinite system matrix A is a n-by-n matrix that has already been factorized by the hetrf() functions and x and b are n-dimensional vectors. Note that the function only works for general, non-adapted matrices with complex<float> or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the vector b contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
hetrf( D, 'L', ipiv.data() );
hetrs( D, x, 'L', ipiv.data() );
assert( A * x == b );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
hetrf( D, 'L', ipiv.data() );
hetrs( D, x, 'L', ipiv.data() );
assert( trans( A ) * x == b );

For more information on the hetrs() functions (i.e. chetrs() and zhetrs()) see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ hetrs() [2/4]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::hetrs ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  B,
char  uplo,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*X=B $).

Parameters
AThe system matrix.
BThe matrix of right-hand sides.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK hetrs() functions to perform the substitution step to compute the solution to a system of symmetric indefinite linear equations:

  • $ A *X =B $ if both A and B are column-major
  • $ A^T*X =B $ if A is row-major and B is column-major
  • $ A *X^T=B^T $ if A is column-major and B is row-major
  • $ A^T*X^T=B^T $ if both A and B are row-major

In this context the symmetric indefinite system matrix A is a n-by-n matrix that has already been factorized by the hetrf() functions and X and B are either row-major m-by-n matrices or column-major n-by-m matrices. Note that the function only works for general, non-adapted matrices with complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the matrix B contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the sizes of the two given matrices do not match;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,columnMajor> B( 2UL, 4UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,columnMajor> X( B ); // Temporary matrix for the solution
hetrf( D, 'L' );
hetrs( D, X, 'L' );
assert( A * X == B );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,rowMajor> B( 4UL, 2UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,rowMajor> X( B ); // Temporary matrix for the solution
hetrf( D, 'L' );
hetrs( D, X, 'L' );
assert( trans( A ) * trans( X ) == trans( B ) );

For more information on the hetrs() functions (i.e. chetrs() and zhetrs()) see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ hetrs() [3/4]

void blaze::hetrs ( char  uplo,
int  n,
int  nrhs,
const complex< float > *  A,
int  lda,
const int *  ipiv,
complex< float > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite single precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the single precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK chetrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the chetrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the chetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ hetrs() [4/4]

void blaze::hetrs ( char  uplo,
int  n,
int  nrhs,
const complex< double > *  A,
int  lda,
const int *  ipiv,
complex< double > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite double precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the double precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK zhetrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the zhetrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the zhetrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [1/6]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::potrs ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  b,
char  uplo 
)
inline

LAPACK kernel for the substitution step of solving a positive definite linear system of equations ( $ A*x=b $).

Parameters
AThe system matrix.
bThe right-hand side vector.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK potrs() functions to perform the substitution step to compute the solution to the system of positive definite linear equations:

  • $ A *x=b $ if A is column-major
  • $ A^T*x=b $ if A is row-major

In this context the positive definite system matrix A is a n-by-n matrix that has already been factorized by the potrf() functions and x and b are n-dimensional vectors. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the vector b contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
potrf( D, 'L' );
potrs( D, x, 'L' );
assert( A * x == b );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
potrf( D, 'L' );
potrs( D, x, 'L' );
assert( trans( A ) * x == b );

For more information on the potrs() functions (i.e. spotrs(), dpotrs(), cpotrs(), and zpotrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [2/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::potrs ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  B,
char  uplo 
)
inline

LAPACK kernel for the substitution step of solving a positive definite linear system of equations ( $ A*X=B $).

Parameters
AThe system matrix.
BThe matrix of right-hand sides.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK potrs() functions to perform the substitution step to compute the solution to a system of positive definite linear equations:

  • $ A *X =B $ if both A and B are column-major
  • $ A^T*X =B $ if A is row-major and B is column-major
  • $ A *X^T=B^T $ if A is column-major and B is row-major
  • $ A^T*X^T=B^T $ if both A and B are row-major

In this context the positive definite system matrix A is a n-by-n matrix that has already been factorized by the potrf() functions and X and B are either row-major m-by-n matrices or column-major n-by-m matrices. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the matrix B contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the sizes of the two given matrices do not match;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,columnMajor> B( 2UL, 4UL ); // The right-hand side matrix B
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,columnMajor> X( B ); // Temporary matrix for the solution
potrf( D, 'L' );
potrs( D, X, 'L' );
assert( A * X == B );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,rowMajor> B( 4UL, 2UL ); // The right-hand side matrix B
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,rowMajor> X( B ); // Temporary matrix for the solution
potrf( D, 'L' );
potrs( D, X, 'L' );
assert( trans( A ) * trans( X ) == trans( B ) );

For more information on the potrs() functions (i.e. spotrs(), dpotrs(), cpotrs(), and zpotrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [3/6]

void blaze::potrs ( char  uplo,
int  n,
int  nrhs,
const float *  A,
int  lda,
float *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a positive definite single precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
BPointer to the first element of the single precision column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK spotrs() function to perform the substitution step to compute the solution to the positive definite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the spotrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the spotrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [4/6]

void blaze::potrs ( char  uplo,
int  n,
int  nrhs,
const double *  A,
int  lda,
double *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a positive definite double precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
BPointer to the first element of the double precision column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK dpotrs() function to perform the substitution step to compute the solution to the positive definite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the dpotrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the dpotrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [5/6]

void blaze::potrs ( char  uplo,
int  n,
int  nrhs,
const complex< float > *  A,
int  lda,
complex< float > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a positive definite single precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
BPointer to the first element of the single precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK cpotrs() function to perform the substitution step to compute the solution to the positive definite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the cpotrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the cpotrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ potrs() [6/6]

void blaze::potrs ( char  uplo,
int  n,
int  nrhs,
const complex< double > *  A,
int  lda,
complex< double > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a positive definite double precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
BPointer to the first element of the double precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK zpotrs() function to perform the substitution step to compute the solution to the positive definite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the zpotrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the zpotrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [1/6]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::sytrs ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  b,
char  uplo,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*x=b $).

Parameters
AThe system matrix.
bThe right-hand side vector.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK sytrs() functions to perform the substitution step to compute the solution to the system of symmetric indefinite linear equations:

  • $ A *x=b $ if A is column-major
  • $ A^T*x=b $ if A is row-major

In this context the symmetric indefinite system matrix A is a n-by-n matrix that has already been factorized by the sytrf() functions and x and b are n-dimensional vectors. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the vector b contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
sytrf( D, 'L', ipiv.data() );
sytrs( D, x, 'L', ipiv.data() );
assert( A * x == b );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
sytrf( D, 'L', ipiv.data() );
sytrs( D, x, 'L', ipiv.data() );
assert( trans( A ) * x == b );

For more information on the sytrs() functions (i.e. ssytrs(), dsytrs(), csytrs(), and zsytrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [2/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::sytrs ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  B,
char  uplo,
const int *  ipiv 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite linear system of equations ( $ A*X=B $).

Parameters
AThe system matrix.
BThe matrix of right-hand sides.
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
ipivAuxiliary array of size n for the pivot indices.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::invalid_argumentInvalid uplo argument provided.

This function uses the LAPACK sytrs() functions to perform the substitution step to compute the solution to a system of symmetric indefinite linear equations:

  • $ A *X =B $ if both A and B are column-major
  • $ A^T*X =B $ if A is row-major and B is column-major
  • $ A *X^T=B^T $ if A is column-major and B is row-major
  • $ A^T*X^T=B^T $ if both A and B are row-major

In this context the symmetric indefinite system matrix A is a n-by-n matrix that has already been factorized by the sytrf() functions and X and B are either row-major m-by-n matrices or column-major n-by-m matrices. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the matrix B contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the sizes of the two given matrices do not match;
  • ... the given uplo argument is neither 'L' nor 'U'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,columnMajor> B( 2UL, 4UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,columnMajor> X( B ); // Temporary matrix for the solution
sytrf( D, 'L' );
sytrs( D, X, 'L' );
assert( A * X == B );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,rowMajor> B( 4UL, 2UL ); // The right-hand side matrix B
DynamicVector<int,columnVector> ipiv( 2UL ); // Pivoting indices
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,rowMajor> X( B ); // Temporary matrix for the solution
sytrf( D, 'L' );
sytrs( D, X, 'L' );
assert( trans( A ) * trans( X ) == trans( B ) );

For more information on the sytrs() functions (i.e. ssytrs(), dsytrs(), csytrs(), and zsytrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [3/6]

void blaze::sytrs ( char  uplo,
int  n,
int  nrhs,
const float *  A,
int  lda,
const int *  ipiv,
float *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite single precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the single precision column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK ssytrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the ssytrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the ssytrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [4/6]

void blaze::sytrs ( char  uplo,
int  n,
int  nrhs,
const double *  A,
int  lda,
const int *  ipiv,
double *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite double precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the double precision column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK dsytrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the dsytrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the dsytrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [5/6]

void blaze::sytrs ( char  uplo,
int  n,
int  nrhs,
const complex< float > *  A,
int  lda,
const int *  ipiv,
complex< float > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite single precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the single precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK csytrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the csytrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the csytrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ sytrs() [6/6]

void blaze::sytrs ( char  uplo,
int  n,
int  nrhs,
const complex< double > *  A,
int  lda,
const int *  ipiv,
complex< double > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a symmetric indefinite double precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' to use the lower part of the matrix, 'U' to use the upper part.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision complex column-major square matrix.
ldaThe total number of elements between two columns of matrix A $[0..\infty)$.
ipivAuxiliary array of size n for the pivot indices.
BPointer to the first element of the double precision complex column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK zsytrs() function to perform the substitution step to compute the solution to the symmetric indefinite system of linear equations $ A*X=B $, where A is a n-by-n matrix that has already been factorized by the zsytrf() function and X and B are column-major n-by-nrhs matrices.

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the zsytrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [1/6]

template<typename MT , bool SO, typename VT , bool TF>
void blaze::trtrs ( const DenseMatrix< MT, SO > &  A,
DenseVector< VT, TF > &  b,
char  uplo,
char  trans,
char  diag 
)
inline

LAPACK kernel for the substitution step of solving a triangular linear system of equations ( $ A*x=b $).

Parameters
AThe system matrix.
bThe right-hand side vector.
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*x=b $, 'T' for $ A^T*x=b $, and C for $ A^H*x=b $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side vector provided.
std::invalid_argumentInvalid uplo argument provided.
std::invalid_argumentInvalid trans argument provided.
std::invalid_argumentInvalid diag argument provided.

This function uses the LAPACK trtrs() functions to perform the substitution step to compute the solution to the triangular system of linear equations:

  • $ A *x=b $ if A is column-major
  • $ A^T*x=b $ if A is row-major

In this context the triangular system matrix A is a n-by-n matrix and x and b are n-dimensional vectors. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the vector b contains the solution of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given uplo argument is neither 'L' nor 'U';
  • ... the given trans argument is neither 'N' nor 'T' nor 'C';
  • ... the given diag argument is neither 'U' nor 'N'.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
trtrs( D, x, 'L', 'N', 'N' );
assert( A * x == b );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicVector<double,columnVector> b( 2UL ); // The right-hand side vector b
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicVector<double,columnVector> x( b ); // Temporary vector for the solution
trtrs( D, x, 'L', 'N', 'N' );
assert( trans( A ) * x == b );

For more information on the trtrs() functions (i.e. strtrs(), dtrtrs(), ctrtrs(), and ztrtrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [2/6]

template<typename MT1 , bool SO1, typename MT2 , bool SO2>
void blaze::trtrs ( const DenseMatrix< MT1, SO1 > &  A,
DenseMatrix< MT2, SO2 > &  B,
char  uplo,
char  trans,
char  diag 
)
inline

LAPACK kernel for the substitution step of solving a triangular linear system of equations ( $ A*X=B $).

Parameters
AThe system matrix.
BThe matrix of right-hand sides.
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*x=b $, 'T' for $ A^T*x=b $, and C for $ A^H*x=b $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
Returns
void
Exceptions
std::invalid_argumentInvalid non-square matrix provided.
std::invalid_argumentInvalid right-hand side matrix provided.
std::invalid_argumentInvalid uplo argument provided.
std::invalid_argumentInvalid trans argument provided.
std::invalid_argumentInvalid diag argument provided.

This function uses the LAPACK getrs() functions to perform the substitution step to compute the solution to the triangular system of linear equations:

  • $ A *X =B $ if both A and B are column-major
  • $ A^T*X =B $ if A is row-major and B is column-major
  • $ A *X^T=B^T $ if A is column-major and B is row-major
  • $ A^T*X^T=B^T $ if both A and B are row-major

In this context the triangular system matrix A is a n-by-n matrix and X and B are either row-major m-by-n matrices or column-major n-by-m matrices. Note that the function only works for general, non-adapted matrices with float, double, complex<float>, or complex<double> element type. The attempt to call the function with adaptors or matrices of any other element type results in a compile time error!

If the function exits successfully, the matrix B contains the solutions of the linear system of equations. The function fails if ...

  • ... the given system matrix is not a square matrix;
  • ... the given uplo argument is neither 'L' nor 'U';
  • ... the given trans argument is neither 'N' nor 'T' nor 'C';
  • ... the given diag argument is neither 'U' nor 'N';
  • ... the sizes of the two given matrices do not match.

In all failure cases a std::invalid_argument exception is thrown.

Examples:

DynamicMatrix<double,columnMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,columnMajor> B( 2UL, 4UL ); // The right-hand side matrix B
// ... Initialization
DynamicMatrix<double,columnMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,columnMajor> X( B ); // Temporary matrix for the solution
trtrs( D, X, 'L', 'N', 'N' );
assert( A * X == B );
DynamicMatrix<double,rowMajor> A( 2UL, 2UL ); // The system matrix A
DynamicMatrix<double,rowMajor> B( 2UL, 4UL ); // The right-hand side matrix B
// ... Initialization
DynamicMatrix<double,rowMajor> D( A ); // Temporary matrix to be decomposed
DynamicMatrix<double,rowMajor> X( B ); // Temporary matrix for the solution
trtrs( D, X, 'L', 'N', 'N' );
assert( trans( A ) * trans( X ) == trans( B ) );

For more information on the trtrs() functions (i.e. strtrs(), dtrtrs(), ctrtrs(), and ztrtrs()), see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [3/6]

void blaze::trtrs ( char  uplo,
char  trans,
char  diag,
int  n,
int  nrhs,
const float *  A,
int  lda,
float *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a triangular single precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK strtrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the strtrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [4/6]

void blaze::trtrs ( char  uplo,
char  trans,
char  diag,
int  n,
int  nrhs,
const double *  A,
int  lda,
double *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a triangular double precision linear system of equations ( $ A*X=B $).

Parameters
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK dtrtrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the dtrtrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [5/6]

void blaze::trtrs ( char  uplo,
char  trans,
char  diag,
int  n,
int  nrhs,
const complex< float > *  A,
int  lda,
complex< float > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a triangular single precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the single precision complex column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK ctrtrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the ctrtrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.

◆ trtrs() [6/6]

void blaze::trtrs ( char  uplo,
char  trans,
char  diag,
int  n,
int  nrhs,
const complex< double > *  A,
int  lda,
complex< double > *  B,
int  ldb,
int *  info 
)
inline

LAPACK kernel for the substitution step of solving a triangular double precision complex linear system of equations ( $ A*X=B $).

Parameters
uplo'L' in case of a lower matrix, 'U' in case of an upper matrix.
trans'N' for $ A*X=B $, 'T' for $ A^T*X=B $, and C for $ A^H*X=B $.
diag'U' in case of a unitriangular matrix, 'N' otherwise.
nThe number of rows/columns of the column-major matrix $[0..\infty)$.
nrhsThe number of right-hand side vectors $[0..\infty)$.
APointer to the first element of the double precision complex column-major square matrix.
ldaThe total number of elements between two columns of the matrix $[0..\infty)$.
BPointer to the first element of the column-major matrix.
ldbThe total number of elements between two columns of matrix B $[0..\infty)$.
infoReturn code of the function call.
Returns
void

This function uses the LAPACK ztrtrs() function to perform the substitution step to compute the solution to the general system of linear equations $ A*X=B $, $ A^{T}*X=B $, or $ A^{H}*X=B $, where A is a n-by-n matrix and X and B are column-major n-by-nrhs matrices. The trans argument specifies the form of the linear system of equations:

  • 'N': $ A*X=B $ (no transpose)
  • 'T': $ A^{T}*X=B $ (transpose)
  • 'C': $ A^{H}*X=B $ (conjugate transpose)

The info argument provides feedback on the success of the function call:

  • = 0: The function finished successfully.
  • < 0: If info = -i, the i-th argument had an illegal value.

For more information on the ztrtrs() function, see the LAPACK online documentation browser:

http://www.netlib.org/lapack/explore-html/

Note
This function can only be used if a fitting LAPACK library, which supports this function, is available and linked to the executable. Otherwise a call to this function will result in a linker error.