|
Correlation 4.10.0
An Analysis Tool for Liquids and for Amorphous Solids
|
A lightweight, constexpr, stack-based 3x3 matrix. More...
#include <LinearAlgebra.hpp>

Public Types | |
| using | value_type = T |
| Scalar type. | |
Public Member Functions | |
| constexpr | Matrix3 () noexcept |
| Default constructor. Initializes all elements to zero. | |
| constexpr | Matrix3 (const Vector3< T > &c_zero, const Vector3< T > &c_one, const Vector3< T > &c_two) noexcept |
| Parameterized constructor from column vectors. | |
| template<typename U> | |
| constexpr | Matrix3 (const Matrix3< U > &other) noexcept |
| constexpr const Vector3< T > & | operator[] (std::size_t col_idx) const noexcept |
| Access column vector by index. | |
| constexpr Vector3< T > & | operator[] (std::size_t col_idx) noexcept |
| Access mutable column vector by index. | |
| constexpr T | operator() (std::size_t row_idx, std::size_t col_idx) const noexcept |
| Access element by row and column. | |
| constexpr T & | operator() (std::size_t row_idx, std::size_t col_idx) noexcept |
| Access mutable element by row and column. | |
| constexpr std::array< std::array< T, 3 >, 3 > | array () const noexcept |
| Converts the matrix to a nested std::array. | |
| constexpr T | trace () const noexcept |
| Computes the matrix trace. | |
| constexpr Matrix3 | operator* (T scalar) const noexcept |
| Matrix-scalar multiplication. | |
| constexpr Matrix3 & | operator*= (T scalar) noexcept |
| In-place scalar multiplication. | |
| constexpr Matrix3 & | operator+= (const Matrix3 &rhs) noexcept |
| In-place matrix addition. | |
| constexpr Matrix3 | operator+ (const Matrix3 &rhs) const noexcept |
| Matrix addition. | |
| constexpr Matrix3 & | operator-= (const Matrix3 &rhs) noexcept |
| In-place matrix subtraction. | |
| constexpr Matrix3 | operator- (const Matrix3 &rhs) const noexcept |
| Matrix subtraction. | |
| constexpr Matrix3 & | operator*= (const Matrix3 &rhs) noexcept |
| In-place matrix-matrix multiplication. | |
| constexpr bool | operator== (const Matrix3 &rhs) const noexcept |
| Equality comparison. | |
| constexpr bool | operator!= (const Matrix3 &rhs) const noexcept |
| Inequality comparison. | |
Static Public Member Functions | |
| static constexpr Matrix3 | identity () noexcept |
| Returns the 3×3 identity matrix. | |
Private Attributes | |
| std::array< Vector3< T >, 3 > | data_ |
| Column vectors of the matrix. | |
A lightweight, constexpr, stack-based 3x3 matrix.
Uses column-major storage format (standard for OpenGL and BLAS). This means data is stored as an array of three column vectors.
| T | The scalar type stored by the matrix. |
| using correlation::math::Matrix3< T >::value_type = T |
Scalar type.
|
inlineconstexprnoexcept |
Default constructor. Initializes all elements to zero.

|
inlineconstexprnoexcept |
Parameterized constructor from column vectors.
| c_zero | First column vector. |
| c_one | Second column vector. |
| c_two | Third column vector. |
|
inlineconstexprnoexcept |
|
inlinenodiscardconstexprnoexcept |
Converts the matrix to a nested std::array.
|
inlinestaticnodiscardconstexprnoexcept |
Returns the 3×3 identity matrix.
|
inlinenodiscardconstexprnoexcept |
Inequality comparison.
| rhs | The matrix to compare with. |
|
inlinenodiscardconstexprnoexcept |
Access element by row and column.
| row_idx | Row index. |
| col_idx | Column index. |
|
inlineconstexprnoexcept |
Access mutable element by row and column.
| row_idx | Row index. |
| col_idx | Column index. |
|
inlinenodiscardconstexprnoexcept |
Matrix-scalar multiplication.
| scalar | Scalar factor. |
|
inlineconstexprnoexcept |
In-place matrix-matrix multiplication.
| rhs | The matrix to multiply with (post-multiplication). |
|
inlineconstexprnoexcept |
In-place scalar multiplication.
| scalar | Scalar factor. |
|
inlinenodiscardconstexprnoexcept |
Matrix addition.
| rhs | The matrix to add. |
|
inlineconstexprnoexcept |
In-place matrix addition.
| rhs | The matrix to add. |
|
inlinenodiscardconstexprnoexcept |
Matrix subtraction.
| rhs | The matrix to subtract. |
|
inlineconstexprnoexcept |
In-place matrix subtraction.
| rhs | The matrix to subtract. |
|
inlinenodiscardconstexprnoexcept |
Equality comparison.
| rhs | The matrix to compare with. |
|
inlinenodiscardconstexprnoexcept |
Access column vector by index.
| col_idx | Column index (0, 1, or 2). |
|
inlineconstexprnoexcept |
Access mutable column vector by index.
| col_idx | Column index (0, 1, or 2). |
|
inlinenodiscardconstexprnoexcept |
Computes the matrix trace.
|
private |
Column vectors of the matrix.