BLAS and LAPACK¶
- template<typename T, int N, int K, int M>
inline void mult(const StaticMatrix<T, N, K> &A, const StaticMatrix<T, K, M> &B, StaticMatrix<T, N, M> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const Matrix<T> &A, const Matrix<T> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const TransposeOp<Matrix<T>> &A, const Matrix<T> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const Matrix<T> &A, const TransposeOp<Matrix<T>> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const TransposeOp<Matrix<T>> &A, const TransposeOp<Matrix<T>> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const Matrix<T> &A, const CSRMatrix<T> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶
- template<typename T>
inline void mult(const CSRMatrix<T> &A, const Matrix<T> &B, Matrix<T> &C, MultParam<T> param = MultParam<T>())¶Calculates the matrix-matrix multiplication: \( \mathbf{C} = \alpha \mathbf{A} \mathbf{B} + \beta \mathbf{C}\).
Complexity: If
A
,B
andC
are dense, \( O(n^3) \) wheren
is the matrix side. IfA
is sparse, \( O(n^2 m) \), wherem
is the number of nonzeros elements inA
.
- Parameters:
A – [in] input matrix A (dense, transposed dense or sparse)
B – [in] input matrix B (dense, transposed dense or sparse)
C – [inout] output matrix C (dense)
alpha – [in] scale parameter for the multiplication (optional, default:
1
)beta – [in] scale parameter for the addition (optional, default:
0
)- Throws:
std::length_error – if `A.cols() != B.rows()`.
std::length_error – if `A.rows() != C.rows()` or `B.cols() != C.cols()` when `beta != 0`
- template<typename T, internal::TypeLayout L>
inline void mult(const Matrix<T> &A, const Vector<T, L> &x, Vector<T, L> &y, MultParam<T> param = MultParam<T>())¶
- template<typename T, internal::TypeLayout L>
inline void mult(const TransposeOp<Matrix<T>> &A, const Vector<T, L> &x, Vector<T, L> &y, MultParam<T> param = MultParam<T>())¶
- template<typename T, internal::TypeLayout L>
inline void mult(const CSRMatrix<T> &A, const Vector<T, L> &x, Vector<T, L> &y, MultParam<T> param = MultParam<T>())¶Calculates the vector-matrix multiplication: \( \vec{y} = \alpha \mathbf{A} \vec{x} + \beta \vec{y}\).
Supported operations:
\( \vec{dy} = \mathbf{dA} \times \vec{dx} \)
\( \vec{dy} = \mathbf{dA}^T \times \vec{dx} \)
\( \vec{dy} = \mathbf{sA} \times \vec{dx} \) where the
d
ands
prefix indicate a dense and sparse matrix/vector, respectively.Complexity: If
A
,x
andy
are dense, \( O(n^2) \) wheren
is the matrix side. IfA
is sparse, \( O(n m) \), wherem
is the number of nonzeros elements inA
.
- Parameters:
A – [in] input matrix expression A
x – [in] input vector expression x
y – [inout] output vector y
alpha – [in] scale parameter for the multiplication (optional, default:
1
)beta – [in] scale parameter for the addition (optional, default:
0
)- Throws:
std::length_error – if `A.cols() != x.size()`.
std::length_error – if `A.rows() != y.size()` when `beta != 0`.
- template<typename T>
struct MultParam¶ #include <blas.h>Abstract object that hold the parameters for the matrix multiplication.