<T>LAPACK 0.1.1
C++ Template Linear Algebra PACKage
Loading...
Searching...
No Matches
BLAS Level 2: matrix-vector operations, O(n^2) work

Matrix operations that perform \(O(n^2)\) work on \(O(n^2)\) data. More...

Functions

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::gemv (Op trans, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, const beta_t &beta, vectorY_t &y)
 General matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::gemv (Op trans, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, vectorY_t &y)
 General matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::ger (const alpha_t &alpha, const vectorX_t &x, const vectorY_t &y, matrixA_t &A)
 General matrix rank-1 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::geru (const alpha_t &alpha, const vectorX_t &x, const vectorY_t &y, matrixA_t &A)
 General matrix rank-1 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::hemv (Uplo uplo, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, const beta_t &beta, vectorY_t &y)
 Hermitian matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::hemv (Uplo uplo, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, vectorY_t &y)
 Hermitian matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_REAL alpha_t, enable_if_t<(is_real< alpha_t >), int > = 0, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, real_type< T > >, pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::her (Uplo uplo, const alpha_t &alpha, const vectorX_t &x, matrixA_t &A)
 Hermitian matrix rank-1 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::her2 (Uplo uplo, const alpha_t &alpha, const vectorX_t &x, const vectorY_t &y, matrixA_t &A)
 Hermitian matrix rank-2 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::symv (Uplo uplo, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, const beta_t &beta, vectorY_t &y)
 Symmetric matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::symv (Uplo uplo, const alpha_t &alpha, const matrixA_t &A, const vectorX_t &x, vectorY_t &y)
 Symmetric matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::syr (Uplo uplo, const alpha_t &alpha, const vectorX_t &x, matrixA_t &A)
 Symmetric matrix rank-1 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::syr2 (Uplo uplo, const alpha_t &alpha, const vectorX_t &x, const vectorY_t &y, matrixA_t &A)
 Symmetric matrix rank-2 update:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, class T = type_t<vectorX_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::trmv (Uplo uplo, Op trans, Diag diag, const matrixA_t &A, vectorX_t &x)
 Triangular matrix-vector multiply:
 
template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, class T = type_t<vectorX_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::trsv (Uplo uplo, Op trans, Diag diag, const matrixA_t &A, vectorX_t &x)
 Solve the triangular matrix-vector equation.
 

Detailed Description

Matrix operations that perform \(O(n^2)\) work on \(O(n^2)\) data.

These are memory bound, since every operation requires a memory read or write.


Function Documentation

◆ gemv() [1/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::gemv ( Op  trans,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
const beta_t beta,
vectorY_t y 
)

General matrix-vector multiply:

\[ y := \alpha op(A) x + \beta y, \]

where \(op(A)\) is one of \(op(A) = A\), \(op(A) = A^T\), \(op(A) = A^H\), or \(op(A) = conj(A)\), alpha and beta are scalars, x and y are vectors, and A is a matrix.

Parameters
[in]transThe operation to be performed:
[in]alphaScalar.
[in]A\(op(A)\) is an m-by-n matrix.
[in]xA n-element vector.
[in]betaScalar.
[in,out]yA m-element vector.

◆ gemv() [2/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::gemv ( Op  trans,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
vectorY_t y 
)

General matrix-vector multiply:

\[ y := \alpha op(A) x, \]

where \(op(A)\) is one of \(op(A) = A\), \(op(A) = A^T\), \(op(A) = A^H\), or \(op(A) = conj(A)\), alpha and beta are scalars, x and y are vectors, and A is a matrix.

Parameters
[in]transThe operation to be performed:
[in]alphaScalar.
[in]A\(op(A)\) is an m-by-n matrix.
[in]xA n-element vector.
[in,out]yA m-element vector.

◆ ger()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::ger ( const alpha_t alpha,
const vectorX_t x,
const vectorY_t y,
matrixA_t A 
)

General matrix rank-1 update:

\[ A := \alpha x y^H + A, \]

where alpha is a scalar, x and y are vectors, and A is an m-by-n matrix.

Parameters
[in]alphaScalar.
[in]xA m-element vector.
[in]yA n-element vector.
[in]AA m-by-n matrix.

◆ geru()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::geru ( const alpha_t alpha,
const vectorX_t x,
const vectorY_t y,
matrixA_t A 
)

General matrix rank-1 update:

\[ A := \alpha x y^T + A, \]

where alpha is a scalar, x and y are vectors, and A is an m-by-n matrix.

Parameters
[in]alphaScalar.
[in]xA m-element vector.
[in]yA n-element vector.
[in]AA m-by-n matrix.

◆ hemv() [1/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::hemv ( Uplo  uplo,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
const beta_t beta,
vectorY_t y 
)

Hermitian matrix-vector multiply:

\[ y := \alpha A x + \beta y, \]

where alpha and beta are scalars, x and y are vectors, and A is an n-by-n Hermitian matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]AA n-by-n Hermitian matrix. Imaginary parts of the diagonal elements need not be set, are assumed to be zero on entry, and are set to zero on exit.
[in]xA n-element vector.
[in]betaScalar.
[in,out]yA n-element vector.

◆ hemv() [2/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::hemv ( Uplo  uplo,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
vectorY_t y 
)

Hermitian matrix-vector multiply:

\[ y := \alpha A x, \]

where alpha and beta are scalars, x and y are vectors, and A is an n-by-n Hermitian matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]AA n-by-n Hermitian matrix. Imaginary parts of the diagonal elements need not be set, are assumed to be zero on entry, and are set to zero on exit.
[in]xA n-element vector.
[in,out]yA n-element vector.

◆ her()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_REAL alpha_t, enable_if_t<(is_real< alpha_t >), int > = 0, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, real_type< T > >, pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::her ( Uplo  uplo,
const alpha_t alpha,
const vectorX_t x,
matrixA_t A 
)

Hermitian matrix rank-1 update:

\[ A := \alpha x x^H + A, \]

where alpha is a real scalar, x is a vector, and A is an n-by-n Hermitian matrix.

Mind that if alpha is complex, the output matrix is no longer Hermitian.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaReal scalar.
[in]xA n-element vector.
[in,out]AA n-by-n Hermitian matrix. Imaginary parts of the diagonal elements need not be set, are assumed to be zero on entry, and are set to zero on exit.

◆ her2()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::her2 ( Uplo  uplo,
const alpha_t alpha,
const vectorX_t x,
const vectorY_t y,
matrixA_t A 
)

Hermitian matrix rank-2 update:

\[ A := \alpha x y^H + \text{conj}(\alpha) y x^H + A, \]

where alpha is a scalar, x and y are vectors, and A is an n-by-n Hermitian matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]xA n-element vector.
[in]yA n-element vector.
[in,out]AA n-by-n Hermitian matrix. Imaginary parts of the diagonal elements need not be set, are assumed to be zero on entry, and are set to zero on exit.

◆ symv() [1/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, TLAPACK_SCALAR beta_t, class T = type_t<vectorY_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T >, pair< beta_t, T > > = 0>
void tlapack::symv ( Uplo  uplo,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
const beta_t beta,
vectorY_t y 
)

Symmetric matrix-vector multiply:

\[ y := \alpha A x + \beta y, \]

where alpha and beta are scalars, x and y are vectors, and A is an n-by-n symmetric matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]AA n-by-n symmetric matrix.
[in]xA n-element vector.
[in]betaScalar.
[in,out]yA n-element vector.

◆ symv() [2/2]

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t>
void tlapack::symv ( Uplo  uplo,
const alpha_t alpha,
const matrixA_t A,
const vectorX_t x,
vectorY_t y 
)

Symmetric matrix-vector multiply:

\[ y := \alpha A x, \]

where alpha and beta are scalars, x and y are vectors, and A is an n-by-n symmetric matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]AA n-by-n symmetric matrix.
[in]xA n-element vector.
[in,out]yA n-element vector.

◆ syr()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::syr ( Uplo  uplo,
const alpha_t alpha,
const vectorX_t x,
matrixA_t A 
)

Symmetric matrix rank-1 update:

\[ A := \alpha x x^T + A, \]

where alpha is a scalar, x is a vector, and A is an n-by-n symmetric matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]xA n-element vector.
[in,out]AA n-by-n symmetric matrix.

◆ syr2()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, TLAPACK_VECTOR vectorY_t, TLAPACK_SCALAR alpha_t, class T = type_t<matrixA_t>, disable_if_allow_optblas_t< pair< alpha_t, T >, pair< matrixA_t, T >, pair< vectorX_t, T >, pair< vectorY_t, T > > = 0>
void tlapack::syr2 ( Uplo  uplo,
const alpha_t alpha,
const vectorX_t x,
const vectorY_t y,
matrixA_t A 
)

Symmetric matrix rank-2 update:

\[ A := \alpha x y^T + \alpha y x^T + A, \]

where alpha is a scalar, x and y are vectors, and A is an n-by-n symmetric matrix.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed from symmetry.
  • Uplo::Lower: only the lower triangular part of A is referenced.
  • Uplo::Upper: only the upper triangular part of A is referenced.
[in]alphaScalar.
[in]xA n-element vector.
[in]yA n-element vector.
[in,out]AA n-by-n symmetric matrix.

◆ trmv()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, class T = type_t<vectorX_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::trmv ( Uplo  uplo,
Op  trans,
Diag  diag,
const matrixA_t A,
vectorX_t x 
)

Triangular matrix-vector multiply:

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

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

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed to be zero.
[in]transThe operation to be performed:
[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]AA n-by-n matrix.
[in,out]xA n-element vector.

◆ trsv()

template<TLAPACK_MATRIX matrixA_t, TLAPACK_VECTOR vectorX_t, class T = type_t<vectorX_t>, disable_if_allow_optblas_t< pair< matrixA_t, T >, pair< vectorX_t, T > > = 0>
void tlapack::trsv ( Uplo  uplo,
Op  trans,
Diag  diag,
const matrixA_t A,
vectorX_t x 
)

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.

Parameters
[in]uploWhat part of the matrix A is referenced, the opposite triangle being assumed to be zero.
[in]transThe equation to be solved:
[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]AA n-by-n matrix.
[in,out]xOn entry, the n-element vector b. On exit, the n-element vector x.