|
| | Matrix (void) |
| | Default constructor initializing square matrices to identity and non-square matrices to zero.
|
| |
| | Matrix (std::initializer_list< MatrixComponentType > values) |
| | Construct from initializer list of Cols*Rows values (row-major order).
|
| |
| | Matrix (MatrixComponentType value) |
| | Construct by filling all components with the same value.
|
| |
| | Matrix (const glm::mat< Cols, Rows, MatrixComponentType > &value) |
| | Construct from a GLM matrix.
|
| |
| | Matrix (const Matrix &other)=default |
| | Copy constructor.
|
| |
| | Matrix (Matrix &&other) noexcept=default |
| | Move constructor.
|
| |
|
| ~Matrix (void)=default |
| | Default destructor for Matrix.
|
| |
| Matrix & | operator= (const Matrix &other)=default |
| | Copy assignment operator.
|
| |
| Matrix & | operator= (Matrix &&other) noexcept=default |
| | Move assignment operator.
|
| |
| Matrix | operator+ (const Matrix &rhs) const noexcept |
| | Matrix addition.
|
| |
| Matrix & | operator+= (const Matrix &rhs) noexcept |
| | Matrix addition assignment.
|
| |
| Matrix | operator- (const Matrix &rhs) const noexcept |
| | Matrix subtraction.
|
| |
| Matrix & | operator-= (const Matrix &rhs) noexcept |
| | Matrix subtraction assignment.
|
| |
| Matrix | operator* (MatrixComponentType scalar) const noexcept |
| | Scalar multiplication.
|
| |
| Matrix & | operator*= (MatrixComponentType scalar) noexcept |
| | Scalar multiplication assignment.
|
| |
| Matrix | operator/ (MatrixComponentType scalar) const |
| | Scalar division.
|
| |
| Matrix & | operator/= (MatrixComponentType scalar) |
| | Scalar division assignment.
|
| |
template<std::size_t RhsCols, std::size_t RhsRows>
requires (Cols == RhsRows) |
| Matrix< MatrixComponentType, RhsCols, Rows > | operator* (const Matrix< MatrixComponentType, RhsCols, RhsRows > &rhs) const noexcept |
| | Matrix multiplication.
|
| |
| Matrix & | operator*= (const Matrix &rhs) noexcept |
| | Matrix multiplication assignment (square matrices only).
|
| |
| bool | operator== (const Matrix &rhs) const noexcept |
| | Equality comparison.
|
| |
| bool | equalsEpsilon (const Matrix &rhs, MatrixComponentType epsilon=MatrixComponentType { 1e-5 }) const |
| | Approximate equality using an epsilon threshold.
|
| |
| bool | operator!= (const Matrix &rhs) const noexcept |
| | Inequality comparison.
|
| |
| Matrix | operator- (void) const noexcept |
| | Unary negation.
|
| |
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
class utility::math::Matrix< MatrixComponentType, Cols, Rows, typename >
M x N matrix class inheriting from glm::mat<Cols, Rows, Type>.
- Template Parameters
-
| MatrixComponentType | Floating-point type for matrix components. |
| Cols | Number of columns (must be 2, 3, or 4). |
| Rows | Number of rows (must be 2, 3, or 4). |
Definition at line 91 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
Default constructor initializing square matrices to identity and non-square matrices to zero.
Definition at line 98 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
| utility::math::Matrix< MatrixComponentType, Cols, Rows, typename >::Matrix |
( |
std::initializer_list< MatrixComponentType > |
values | ) |
|
|
inline |
Construct from initializer list of Cols*Rows values (row-major order).
- Parameters
-
| values | The initializer list containing matrix components. |
- Exceptions
-
| std::invalid_argument | if the list size is not Cols*Rows. |
Definition at line 116 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
Construct by filling all components with the same value.
- Parameters
-
| value | The value to fill all components with. |
Definition at line 135 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
| bool utility::math::Matrix< MatrixComponentType, Cols, Rows, typename >::equalsEpsilon |
( |
const Matrix< MatrixComponentType, Cols, Rows, typename > & |
rhs, |
|
|
MatrixComponentType |
epsilon = MatrixComponentType { 1e-5 } |
|
) |
| const |
|
inline |
Approximate equality using an epsilon threshold.
Returns true if each component is within epsilon of its counterpart in rhs.
- Parameters
-
| rhs | The matrix to compare with. |
| epsilon | The maximum allowed difference per component. |
- Returns
- True if the matrices are equal within epsilon.
Definition at line 355 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
template<std::size_t RhsCols, std::size_t RhsRows>
requires (Cols == RhsRows)
| Matrix< MatrixComponentType, RhsCols, Rows > utility::math::Matrix< MatrixComponentType, Cols, Rows, typename >::operator* |
( |
const Matrix< MatrixComponentType, RhsCols, RhsRows > & |
rhs | ) |
const |
|
inlinenoexcept |
Matrix multiplication.
- Template Parameters
-
| RhsCols | Number of columns of the RHS matrix. |
| RhsRows | Number of rows of the RHS matrix. |
- Parameters
-
| rhs | The matrix to multiply with. |
- Returns
- The resulting matrix with shape (Rows, RhsCols).
- Note
- Requires this matrix's column count to equal the RHS row count (Cols == RhsRows).
Definition at line 304 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
| bool utility::math::Matrix< MatrixComponentType, Cols, Rows, typename >::operator== |
( |
const Matrix< MatrixComponentType, Cols, Rows, typename > & |
rhs | ) |
const |
|
inlinenoexcept |
Equality comparison.
Uses exact component-wise equality. For floating-point types prefer equalsEpsilon to tolerate rounding error.
- Parameters
-
| rhs | The matrix to compare with. |
- Returns
- True if the matrices are equal, false otherwise.
Definition at line 338 of file matrix.hpp.
template<CanBeMatrixComponent MatrixComponentType, std::size_t Cols, std::size_t Rows, typename = std::enable_if_t<(Cols >= 2) && (Cols <= 4) && (Rows >= 2) && (Rows <= 4)>>
| Matrix operator* |
( |
MatrixComponentType |
scalar, |
|
|
const Matrix< MatrixComponentType, Cols, Rows, typename > & |
mat |
|
) |
| |
|
friend |
Friend function for scalar multiplication with scalar on the left.
- Parameters
-
| scalar | The scalar value to multiply with. |
| mat | The matrix to multiply. |
- Returns
- The resulting matrix.
Definition at line 397 of file matrix.hpp.