|
|
constexpr | Mat () noexcept=default |
| | Default-constructs a zero-initialized matrix.
|
| |
template<std::size_t R2, std::size_t C2>
requires (R2 != Rows || C2 != Cols) |
| constexpr | Mat (Mat< R2, C2, T > const &other) noexcept |
| | Cross-size constructor — copies the overlapping region, zero-fills the rest.
|
| |
template<std::convertible_to< row_type >... Rs>
requires (sizeof...(Rs) == Rows) |
| constexpr | Mat (Rs &&... rs) noexcept |
| | Constructs a matrix from Rows row vectors.
|
| |
| template<std::predicate< T > Pred> |
| constexpr bool | all_of (Pred &&pred) const noexcept |
| | Returns true if all elements satisfy the predicate.
|
| |
| template<std::predicate< T > Pred> |
| constexpr bool | any_of (Pred &&pred) const noexcept |
| | Returns true if at least one element satisfies the predicate.
|
| |
| constexpr auto & | at (this auto &self, size_type r, size_type c) |
| | Bounds-checked access to the element at row r, column c.
|
| |
| constexpr auto | begin (this auto &self) noexcept |
| | Returns an iterator to the first row.
|
| |
| template<std::size_t R2> |
| constexpr auto | block (std::size_t start_row, std::size_t start_col) const noexcept -> Mat< R2, R2, T > requires(R2<=Rows &&R2<=Cols) |
| | Extracts a square sub-matrix of size R2 × R2 starting at (start_row, start_col).
|
| |
| constexpr col_type | col (size_type c) const noexcept |
| | Returns column c as a Vec<Rows, T> (by value).
|
| |
| constexpr T | conditionNumber () const noexcept |
| | Estimates the condition number using the Frobenius norm.
|
| |
| constexpr auto | data (this auto &self) noexcept |
| | Returns a pointer to the first row.
|
| |
| constexpr auto | end (this auto &self) noexcept |
| | Returns a past-the-end row iterator.
|
| |
| template<class U > |
| constexpr | explicit (!std::is_same_v< T, U >) Mat(Mat< Rows |
| | Converting constructor from a matrix with a different element type.
|
| |
template<std::convertible_to< T >... Args>
requires (sizeof...(Args) == Rows * Cols) |
| | explicit (sizeof...(Args)==1) const expr Mat(Args... args) noexcept |
| | Constructs a matrix from exactly Rows * Cols element values (row-major).
|
| |
| constexpr auto | flat_view (this auto &self) noexcept |
| | Returns a flat std::span<T, Rows * Cols> over all elements (row-major).
|
| |
| constexpr T | frobenius_norm () const noexcept |
| | Computes the Frobenius norm of the matrix.
|
| |
| constexpr bool | isDiagonal (T epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
| | Returns true if all off-diagonal elements are within epsilon of zero.
|
| |
| constexpr bool | isLowerTriangular (T epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
| | Returns true if all elements above the main diagonal are within epsilon of zero.
|
| |
| constexpr bool | isNearZero (T epsilon=std::numeric_limits< T >::epsilon() *T(100)) const noexcept |
| | Returns true if the Frobenius norm is less than epsilon.
|
| |
| constexpr bool | isSymmetric (T epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
| | Returns true if the matrix equals its transpose (within epsilon).
|
| |
| constexpr bool | isUpperTriangular (T epsilon=std::numeric_limits< T >::epsilon()) const noexcept |
| | Returns true if all elements below the main diagonal are within epsilon of zero.
|
| |
| constexpr Mat & | operator*= (Mat const &rhs) noexcept |
| | Multiplies this square matrix by rhs (matrix product, square matrices only).
|
| |
| constexpr Mat & | operator*= (T rhs) noexcept |
| | Multiplies every element by scalar rhs.
|
| |
| constexpr Mat | operator+ () const noexcept |
| | Unary identity operator.
|
| |
| constexpr Mat & | operator+= (Mat const &rhs) noexcept |
| | Adds rhs element-wise to this matrix.
|
| |
| constexpr Mat & | operator+= (T rhs) noexcept |
| | Adds scalar rhs to every element.
|
| |
| constexpr Mat | operator- () const noexcept |
| | Unary negation operator.
|
| |
| constexpr Mat & | operator-= (Mat const &rhs) noexcept |
| | Subtracts rhs element-wise from this matrix.
|
| |
| constexpr Mat & | operator-= (T rhs) noexcept |
| | Subtracts scalar rhs from every element.
|
| |
| constexpr Mat & | operator/= (T rhs) noexcept |
| | Divides every element by scalar rhs.
|
| |
| constexpr bool | operator== (Mat const &) const =default |
| | Compares two matrices for equality (element-wise).
|
| |
| constexpr auto & | operator[] (this auto &self, size_type i) noexcept |
| | Accesses row i as a Vec<Cols, T>.
|
| |
| constexpr auto & | operator[] (this auto &self, size_type r, size_type c) noexcept |
| | Accesses the element at row r, column c.
|
| |
| constexpr std::size_t | rank (T epsilon=std::numeric_limits< T >::epsilon() *T(1000)) const noexcept |
| | Estimates the matrix rank via Gaussian elimination.
|
| |
| constexpr row_type const & | row (size_type r) const noexcept |
| | Returns a const reference to row r.
|
| |
| constexpr std::optional< Mat > | safe_inverse (T epsilon=std::numeric_limits< T >::epsilon() *T(1000)) const noexcept |
| | Computes the inverse, returning std::nullopt for near-singular matrices.
|
| |
| constexpr T | trace () const noexcept |
| | Computes the trace (sum of diagonal elements) of a square matrix.
|
| |
| template<class UnaryOp > |
| constexpr Mat | transform (UnaryOp &&op) const noexcept |
| | Applies a unary operation to each element and returns the resulting matrix.
|
| |
template<std::size_t Rows, std::size_t Cols, class T>
struct ufo::Mat< Rows, Cols, T >
A fixed-size matrix with Rows rows and Cols columns.
- Template Parameters
-
| Rows | Number of rows. |
| Cols | Number of columns. |
| T | Arithmetic element type (e.g., float, double). |
Storage is row-major: fields[r] gives row r as a Vec<Cols, T>.
Definition at line 113 of file mat.hpp.