|
MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
|
Namespaces | |
| namespace | fixed |
| namespace | non_fixed |
| namespace | expr |
| namespace | view |
Classes | |
| class | block_diagonal2D |
| Block diagonal matrix – stores vector of dense2D blocks. More... | |
| class | block_matrix_view |
| Read-only, row-major view of a rows x cols matrix stored as blocks of the scheme S, cols / S::block_size blocks per row. More... | |
| class | compressed2D |
| CSR sparse matrix: three arrays – data (values), indices (column indices), starts (row pointers of length nrows+1). More... | |
| class | coordinate2D |
| COO sparse matrix: stores (row, col, value) triplets. More... | |
| class | dense2D |
| Dense row/column-major matrix with configurable dimensions and storage. More... | |
| class | ell_matrix |
| ELLPACK sparse matrix: each row stores up to max_width non-zeros. More... | |
| class | identity2D |
| Implicit identity matrix: no storage, O(1) element access. More... | |
| struct | update_store |
| Overwrite: a = b (default updater). More... | |
| struct | update_plus |
| Accumulate: a += b. More... | |
| class | compressed2D_inserter |
| RAII inserter for compressed2D. More... | |
| struct | parameters |
| Parameter bundle for matrix types. More... | |
| class | permutation_matrix |
| Implicit permutation matrix – stores only perm vector, O(n) storage. More... | |
| class | shifted_inserter |
| Offset decorator for sparse matrix inserters. More... | |
| struct | fixed_dimensions |
Typedefs | |
| template<typename Value, typename Orientation = tag::row_major> | |
| using | const_matrix_view |
| A read-only dense matrix over memory the caller owns (tag::read_only): const access only, no allocation, no copy of the elements. | |
| template<typename Matrix, typename Updater = update_store<typename Matrix::value_type>> | |
| using | inserter |
| Convenience alias: inserter<MatrixType, Updater>. | |
Functions | |
| template<typename Value, typename VV, typename VP> | |
| auto | operator* (const block_diagonal2D< Value > &BD, const vec::dense_vector< VV, VP > &x) |
| template<BlockScheme S, Vector V> requires (!Matrix<V>) | |
| auto | operator* (const block_matrix_view< S > &A, const V &x) |
| A * x into a new dense_vector, through mult(). | |
| template<typename Value> | |
| const_matrix_view< Value > | const_view (std::size_t rows, std::size_t cols, const Value *ptr) |
| A read-only row-major view of the rows x cols elements at ptr. | |
| template<typename Value, typename Parameters> | |
| auto | const_view (const dense2D< Value, Parameters > &A) |
| A read-only view of A's elements, in A's orientation and index base: hand a matrix to code that must not change it, without copying it. | |
| template<typename Value, typename Parameters> | |
| void | const_view (const dense2D< Value, Parameters > &&)=delete |
| A view of a temporary would dangle at the end of the full-expression. | |
| template<typename Value, typename Parameters> | |
| auto | num_rows (const dense2D< Value, Parameters > &m) |
| template<typename Value, typename Parameters> | |
| auto | num_cols (const dense2D< Value, Parameters > &m) |
| template<typename Value, typename Parameters> | |
| auto | size (const dense2D< Value, Parameters > &m) |
| template<typename M1, typename M2> requires (Matrix<std::remove_cvref_t<M1>> && Matrix<std::remove_cvref_t<M2>>) | |
| auto | operator+ (M1 &&a, M2 &&b) |
| template<typename M1, typename M2> requires (Matrix<std::remove_cvref_t<M1>> && Matrix<std::remove_cvref_t<M2>>) | |
| auto | operator- (M1 &&a, M2 &&b) |
| template<typename M> requires Matrix<std::remove_cvref_t<M>> | |
| auto | operator- (M &&m) |
| template<typename S, typename M> requires ((!Collection<S> && Scalar<S>) && Matrix<std::remove_cvref_t<M>>) | |
| auto | operator* (const S &alpha, M &&m) |
| template<typename M, typename S> requires (Matrix<std::remove_cvref_t<M>> && (!Collection<S> && Scalar<S>)) | |
| auto | operator* (M &&m, const S &alpha) |
| template<typename M, typename S> requires (Matrix<std::remove_cvref_t<M>> && (!Collection<S> && Scalar<S>)) | |
| auto | operator/ (M &&m, const S &alpha) |
| template<Matrix M, Vector V> requires (!Matrix<V>) | |
| auto | operator* (const M &A, const V &x) |
| template<Matrix M1, Matrix M2> | |
| auto | operator* (const M1 &A, const M2 &B) |
| template<typename V1, typename P1, typename V2, typename P2> | |
| auto | operator* (const compressed2D< V1, P1 > &A, const compressed2D< V2, P2 > &B) |
| template<typename V, typename P, typename VV, typename VP> | |
| auto | operator* (const compressed2D< V, P > &A, const vec::dense_vector< VV, VP > &x) |
| template<typename V, typename P, typename VV, typename VP> | |
| auto | operator* (const view::transposed_view< compressed2D< V, P > > &At, const vec::dense_vector< VV, VP > &x) |
| template<typename Value, typename VV, typename VP> | |
| auto | operator* (const permutation_matrix< Value > &P, const vec::dense_vector< VV, VP > &x) |
| template<typename Value, typename Params> | |
| dense2D< Value, Params > | reorder_rows (const dense2D< Value, Params > &A, const std::vector< std::size_t > &perm) |
| Reorder rows: B(i,:) = A(perm[i],:). | |
| template<typename Value, typename Params> | |
| dense2D< Value, Params > | reorder_cols (const dense2D< Value, Params > &A, const std::vector< std::size_t > &perm) |
| Reorder columns: B(:,j) = A(:,perm[j]). | |
| template<typename Value, typename Params> | |
| dense2D< Value, Params > | reorder (const dense2D< Value, Params > &A, const std::vector< std::size_t > &perm) |
| Symmetric reorder: B = P * A * P^T B(i,j) = A(perm[i], perm[j]). | |
| template<typename PV, typename MV, typename MP> | |
| dense2D< std::common_type_t< PV, MV >, MP > | operator* (const permutation_matrix< PV > &P, const dense2D< MV, MP > &A) |
| P * A: permutation_matrix times dense2D -> reorder_rows. | |
| using mtl::mat::const_matrix_view |
A read-only dense matrix over memory the caller owns (tag::read_only): const access only, no allocation, no copy of the elements.
The buffer holds rows x cols elements in Orientation order with no padding.
| using mtl::mat::inserter |
Convenience alias: inserter<MatrixType, Updater>.
|
delete |
A view of a temporary would dangle at the end of the full-expression.
| auto mtl::mat::const_view | ( | const dense2D< Value, Parameters > & | A | ) |
A read-only view of A's elements, in A's orientation and index base: hand a matrix to code that must not change it, without copying it.
A must outlive the view.
| const_matrix_view< Value > mtl::mat::const_view | ( | std::size_t | rows, |
| std::size_t | cols, | ||
| const Value * | ptr ) |
A read-only row-major view of the rows x cols elements at ptr.
For a column-major buffer, use const_matrix_view<Value, tag::col_major> directly. The buffer must outlive the view.
| auto mtl::mat::num_cols | ( | const dense2D< Value, Parameters > & | m | ) |
| auto mtl::mat::num_rows | ( | const dense2D< Value, Parameters > & | m | ) |
| auto mtl::mat::operator* | ( | const block_diagonal2D< Value > & | BD, |
| const vec::dense_vector< VV, VP > & | x ) |
| auto mtl::mat::operator* | ( | const block_matrix_view< S > & | A, |
| const V & | x ) |
A * x into a new dense_vector, through mult().
Found by ADL, and more specialized than the generic Matrix * Vector operator, which would decode one block per element.
| auto mtl::mat::operator* | ( | const compressed2D< V, P > & | A, |
| const vec::dense_vector< VV, VP > & | x ) |
| auto mtl::mat::operator* | ( | const compressed2D< V1, P1 > & | A, |
| const compressed2D< V2, P2 > & | B ) |
| auto mtl::mat::operator* | ( | const M & | A, |
| const V & | x ) |
| auto mtl::mat::operator* | ( | const M1 & | A, |
| const M2 & | B ) |
| dense2D< std::common_type_t< PV, MV >, MP > mtl::mat::operator* | ( | const permutation_matrix< PV > & | P, |
| const dense2D< MV, MP > & | A ) |
P * A: permutation_matrix times dense2D -> reorder_rows.
| auto mtl::mat::operator* | ( | const permutation_matrix< Value > & | P, |
| const vec::dense_vector< VV, VP > & | x ) |
| auto mtl::mat::operator* | ( | const S & | alpha, |
| M && | m ) |
| auto mtl::mat::operator* | ( | const view::transposed_view< compressed2D< V, P > > & | At, |
| const vec::dense_vector< VV, VP > & | x ) |
| auto mtl::mat::operator* | ( | M && | m, |
| const S & | alpha ) |
| auto mtl::mat::operator+ | ( | M1 && | a, |
| M2 && | b ) |
| auto mtl::mat::operator- | ( | M && | m | ) |
| auto mtl::mat::operator- | ( | M1 && | a, |
| M2 && | b ) |
| auto mtl::mat::operator/ | ( | M && | m, |
| const S & | alpha ) |
| dense2D< Value, Params > mtl::mat::reorder | ( | const dense2D< Value, Params > & | A, |
| const std::vector< std::size_t > & | perm ) |
Symmetric reorder: B = P * A * P^T B(i,j) = A(perm[i], perm[j]).
| dense2D< Value, Params > mtl::mat::reorder_cols | ( | const dense2D< Value, Params > & | A, |
| const std::vector< std::size_t > & | perm ) |
Reorder columns: B(:,j) = A(:,perm[j]).
| dense2D< Value, Params > mtl::mat::reorder_rows | ( | const dense2D< Value, Params > & | A, |
| const std::vector< std::size_t > & | perm ) |
Reorder rows: B(i,:) = A(perm[i],:).
| auto mtl::mat::size | ( | const dense2D< Value, Parameters > & | m | ) |