|
|
constexpr T & | operator() (const Size row, const Size col) |
| | Access element at row row, column col (mutable).
|
| |
|
constexpr const T & | operator() (const Size row, const Size col) const |
| | Access element at row row, column col (read-only).
|
| |
|
template<typename U > |
| constexpr bool | operator== (const Matrix< U, R, C > &rhs) const |
| | Exact element-wise equality. Prefer equalWithin(rhs, thresh) for floats.
|
| |
|
template<typename U > |
| constexpr bool | operator!= (const Matrix< U, R, C > &rhs) const |
| | Inequality (exact). Prefer negated equalWithin(rhs, thresh) for floats.
|
| |
| constexpr Matrix< T, 1, C > | row (const Size n) const |
| | Extract row n as a 1×C matrix.
|
| |
| template<Size startIndex, Size endIndex> |
| constexpr Matrix< T, 1, endIndex - startIndex+1 > | row (const Size n) const |
| | Extract a contiguous subset of row n.
|
| |
| constexpr Matrix< T, R, 1 > | col (const Size n) const |
| | Extract column n as an R×1 matrix.
|
| |
| template<Size startIndex, Size endIndex> |
| constexpr Matrix< T, endIndex - startIndex+1, 1 > | col (const Size n) const |
| | Extract a contiguous subset of column n.
|
| |
| template<Size numRows, Size numCols> |
| constexpr Matrix< T, numRows, numCols > | block (Size startRow, Size startCol) const |
| | Extract a rectangular submatrix.
|
| |
| constexpr void | setRow (const Matrix< T, 1, C > &mat, const Size n) |
| | Overwrite row n with the contents of mat.
|
| |
| template<Size startIndex, Size endIndex> |
| constexpr void | setRow (const Matrix< T, 1, endIndex - startIndex+1 > &mat, const Size n) |
| | Overwrite a contiguous subset of row n.
|
| |
| constexpr void | setCol (const Matrix< T, R, 1 > &mat, const Size n) |
| | Overwrite column n with the contents of mat.
|
| |
| template<Size startIndex, Size endIndex> |
| constexpr void | setCol (const Matrix< T, endIndex - startIndex+1, 1 > &mat, const Size n) |
| | Overwrite a contiguous subset of column n.
|
| |
| template<Size numRows, Size numCols> |
| constexpr void | setBlock (const Matrix< T, numRows, numCols > &mat, Size startRow, Size startCol) |
| | Overwrite a rectangular subregion of this matrix.
|
| |
|
constexpr bool | isSquare () const |
| | Returns true if the matrix has equal row and column counts.
|
| |
| constexpr bool | isSymmetric () const |
| | Returns true if the matrix is symmetric within machine epsilon.
|
| |
| template<typename U > |
| constexpr bool | isSymmetric (const U thresh) const |
| | Returns true if the matrix is symmetric within thresh.
|
| |
| constexpr bool | equalWithin (const Matrix< T, R, C > &rhs, const T thresh) const |
| | Returns true if every element of rhs is within thresh of the corresponding element of *this.
|
| |
|
constexpr Size | rows () const |
| | Number of rows (same as template parameter R).
|
| |
|
constexpr Size | cols () const |
| | Number of columns (same as template parameter C).
|
| |
|
constexpr T * | data () |
| | Raw pointer to first element (mutable).
|
| |
|
constexpr const T * | data () const |
| | Raw pointer to first element (read-only).
|
| |
|
| constexpr Matrix< T, C, R > | transpose () const |
| | Member convenience wrappers that delegate to free functions.
|
| |
|
constexpr T | trace () const |
| | Returns the trace. Delegates to consteig::trace.
|
| |
|
constexpr T | determinant () const |
| | Returns the determinant. Delegates to consteig::determinant.
|
| |
|
constexpr T | norm () const |
| | Returns the Frobenius norm. Delegates to consteig::norm.
|
| |
|
constexpr T | dot (const Matrix< T, R, C > &other) const |
| | Dot product with other. Delegates to consteig::dot.
|
| |
template<
typename T, Size R, Size C>
class consteig::Matrix< T, R, C >
Fixed-size matrix with compile-time dimensions.
The primary container type for all consteig operations. All member functions are constexpr, enabling full compile-time evaluation when the matrix is declared static constexpr.
Storage is row-major: _data[i][j] holds row i, column j. Element access uses operator()(i, j) using zero-based indices.
- Template Parameters
-
| T | Scalar element type. Floating-point types (float, double, long double) are required for eigensolver and decomposition operations. Integer types are supported for pure arithmetic. |
| R | Number of rows (compile-time constant). |
| C | Number of columns (compile-time constant). |
{1.0, 2.0},
{3.0, 4.0}
}};
static constexpr double val =
A(0, 1);
Fixed-size matrix with compile-time dimensions.
Definition matrix.hpp:56
constexpr T epsilon()
Machine epsilon for type T.
Definition utilities.hpp:82