![]() |
Shamrock 2025.10.0
Astrophysical Code
|
Matrix class with runtime size based on std::vector storage and mdspan. More...
#include <shammath/include/shammath/matrix.hpp>
Public Member Functions | |
| mat_d (int rows, int columns) | |
| Constructor. | |
| constexpr auto | get_mdspan () |
| Get the matrix data as a mdspan. | |
| constexpr auto | get_mdspan () const |
| const overload | |
| constexpr T & | operator() (int i, int j) |
| Access the matrix entry at position (i, j). | |
| constexpr const T & | operator() (int i, int j) const |
| const overload | |
| bool | operator== (const mat_d< T > &other) const |
| Check if this matrix is equal to another one. | |
| mat_d & | operator+= (const mat_d &other) |
| Addition operator for matrices. | |
| bool | equal_at_precision (const mat_d< T > &other, const T precision) const |
| check if this matrix is equal to another one at a given precison | |
Public Attributes | |
| std::vector< T > | data |
| The matrix data. | |
| int | rows |
| Number of rows. | |
| int | columns |
| Number of columns. | |
Matrix class with runtime size based on std::vector storage and mdspan.
| T | the type of the matrix entries |
Definition at line 130 of file matrix.hpp.
|
inline |
Constructor.
Definition at line 140 of file matrix.hpp.
|
inline |
check if this matrix is equal to another one at a given precison
Definition at line 170 of file matrix.hpp.
|
inlineconstexpr |
Get the matrix data as a mdspan.
Definition at line 143 of file matrix.hpp.
|
inlineconstexpr |
const overload
Definition at line 148 of file matrix.hpp.
|
inlineconstexpr |
Access the matrix entry at position (i, j).
Definition at line 153 of file matrix.hpp.
|
inlineconstexpr |
|
inline |
Addition operator for matrices.
Definition at line 162 of file matrix.hpp.
|
inline |
Check if this matrix is equal to another one.
Definition at line 159 of file matrix.hpp.
| int shammath::mat_d< T >::columns |
Number of columns.
Definition at line 137 of file matrix.hpp.
| std::vector<T> shammath::mat_d< T >::data |
The matrix data.
Definition at line 133 of file matrix.hpp.
| int shammath::mat_d< T >::rows |
Number of rows.
Definition at line 135 of file matrix.hpp.