BLAS++ 2024.05.31
BLAS C++ API
Loading...
Searching...
No Matches
trsv: Triangular matrix-vector solve

\(x = op(A^{-1})\; b\) More...

Functions

template<typename TA , typename TX >
void blas::trsv (blas::Layout layout, blas::Uplo uplo, blas::Op trans, blas::Diag diag, int64_t n, TA const *A, int64_t lda, TX *x, int64_t incx)
 Solve the triangular matrix-vector equation.
 
void blas::trsv (blas::Layout layout, blas::Uplo uplo, blas::Op trans, blas::Diag diag, int64_t n, float const *A, int64_t lda, float *x, int64_t incx)
 CPU, float version.
 
void blas::trsv (blas::Layout layout, blas::Uplo uplo, blas::Op trans, blas::Diag diag, int64_t n, double const *A, int64_t lda, double *x, int64_t incx)
 CPU, double version.
 
void blas::trsv (blas::Layout layout, blas::Uplo uplo, blas::Op trans, blas::Diag diag, int64_t n, std::complex< float > const *A, int64_t lda, std::complex< float > *x, int64_t incx)
 CPU, complex<float> version.
 
void blas::trsv (blas::Layout layout, blas::Uplo uplo, blas::Op trans, blas::Diag diag, int64_t n, std::complex< double > const *A, int64_t lda, std::complex< double > *x, int64_t incx)
 CPU, complex<double> version.
 

Detailed Description

\(x = op(A^{-1})\; b\)

Function Documentation

◆ trsv()

template<typename TA , typename TX >
void blas::trsv ( blas::Layout  layout,
blas::Uplo  uplo,
blas::Op  trans,
blas::Diag  diag,
int64_t  n,
TA const *  A,
int64_t  lda,
TX *  x,
int64_t  incx 
)

Solve the triangular matrix-vector equation.

\[ op(A) x = b, \]

where \(op(A)\) is one of \(op(A) = A\), \(op(A) = A^T\), or \(op(A) = A^H\), x and b are vectors, and A is an n-by-n, unit or non-unit, upper or lower triangular matrix.

No test for singularity or near-singularity is included in this routine. Such tests must be performed before calling this routine.

See also
LAPACK's latrs for a more numerically robust implementation.

Generic implementation for arbitrary data types.

Parameters
[in]layoutMatrix storage, Layout::ColMajor or Layout::RowMajor.
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed to be zero.
  • Uplo::Lower: A is lower triangular.
  • Uplo::Upper: A is upper triangular.
[in]transThe equation to be solved:
  • Op::NoTrans: \(A x = b\),
  • Op::Trans: \(A^T x = b\),
  • Op::ConjTrans: \(A^H x = b\).
[in]diagWhether A has a unit or non-unit diagonal:
  • Diag::Unit: A is assumed to be unit triangular. The diagonal elements of A are not referenced.
  • Diag::NonUnit: A is not assumed to be unit triangular.
[in]nNumber of rows and columns of the matrix A. n >= 0.
[in]AThe n-by-n matrix A, stored in an lda-by-n array [RowMajor: n-by-lda].
[in]ldaLeading dimension of A. lda >= max(1, n).
[in,out]xThe n-element vector x, in an array of length (n-1)*abs(incx) + 1.
[in]incxStride between elements of x. incx must not be zero. If incx < 0, uses elements of x in reverse order: x(n-1), ..., x(0).