UFO 1.0.0
An Efficient Probabilistic 3D Mapping Framework That Embraces the Unknown
Loading...
Searching...
No Matches
ufo::Mat< Rows, Cols, T > Struct Template Reference

A fixed-size matrix with Rows rows and Cols columns. More...

#include <lib/numeric/include/ufo/numeric/mat.hpp>

Public Types

using col_type = Vec< Rows, T >
 
using row_type = Vec< Cols, T >
 
using size_type = std::size_t
 
using value_type = T
 

Public Member Functions

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 Matoperator*= (Mat const &rhs) noexcept
 Multiplies this square matrix by rhs (matrix product, square matrices only).
 
constexpr Matoperator*= (T rhs) noexcept
 Multiplies every element by scalar rhs.
 
constexpr Mat operator+ () const noexcept
 Unary identity operator.
 
constexpr Matoperator+= (Mat const &rhs) noexcept
 Adds rhs element-wise to this matrix.
 
constexpr Matoperator+= (T rhs) noexcept
 Adds scalar rhs to every element.
 
constexpr Mat operator- () const noexcept
 Unary negation operator.
 
constexpr Matoperator-= (Mat const &rhs) noexcept
 Subtracts rhs element-wise from this matrix.
 
constexpr Matoperator-= (T rhs) noexcept
 Subtracts scalar rhs from every element.
 
constexpr Matoperator/= (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< Matsafe_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.
 

Static Public Member Functions

static constexpr std::size_t cols () noexcept
 Returns the number of columns.
 
static consteval Mat identity () noexcept
 Returns the identity matrix (square matrices only).
 
static constexpr bool is_column_major () noexcept
 Returns false (storage is row-major).
 
static constexpr bool is_row_major () noexcept
 Returns true (storage is row-major).
 
static constexpr std::size_t memory_footprint () noexcept
 Returns the size of this matrix type in bytes.
 
static consteval Mat ones () noexcept
 Returns a matrix with all elements set to T(1).
 
static constexpr std::size_t rows () noexcept
 Returns the number of rows.
 
static constexpr std::size_t size () noexcept
 Returns the total number of elements (Rows * Cols).
 
static consteval Mat zeros () noexcept
 Returns a zero-initialized matrix.
 

Public Attributes

constexpr Cols
 
std::array< row_type, Rows > fields {}
 
constexpr U const &other noexcept
 

Detailed Description

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
RowsNumber of rows.
ColsNumber of columns.
TArithmetic 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.

Member Typedef Documentation

◆ col_type

template<std::size_t Rows, std::size_t Cols, class T >
using ufo::Mat< Rows, Cols, T >::col_type = Vec<Rows, T>

Definition at line 117 of file mat.hpp.

◆ row_type

template<std::size_t Rows, std::size_t Cols, class T >
using ufo::Mat< Rows, Cols, T >::row_type = Vec<Cols, T>

Definition at line 116 of file mat.hpp.

◆ size_type

template<std::size_t Rows, std::size_t Cols, class T >
using ufo::Mat< Rows, Cols, T >::size_type = std::size_t

Definition at line 115 of file mat.hpp.

◆ value_type

template<std::size_t Rows, std::size_t Cols, class T >
using ufo::Mat< Rows, Cols, T >::value_type = T

Definition at line 114 of file mat.hpp.

Constructor & Destructor Documentation

◆ Mat() [1/2]

template<std::size_t Rows, std::size_t Cols, class T >
template<std::convertible_to< row_type >... Rs>
requires (sizeof...(Rs) == Rows)
constexpr ufo::Mat< Rows, Cols, T >::Mat ( Rs &&...  rs)
inlineconstexprnoexcept

Constructs a matrix from Rows row vectors.

Template Parameters
RsRow vector types, each convertible to row_type.
Parameters
[in]rsRow vectors in order from row 0 to row Rows - 1.

Definition at line 181 of file mat.hpp.

◆ Mat() [2/2]

template<std::size_t Rows, std::size_t Cols, class T >
template<std::size_t R2, std::size_t C2>
requires (R2 != Rows || C2 != Cols)
constexpr ufo::Mat< Rows, Cols, T >::Mat ( Mat< R2, C2, T > const &  other)
inlineexplicitconstexprnoexcept

Cross-size constructor — copies the overlapping region, zero-fills the rest.

Template Parameters
R2Source number of rows.
C2Source number of columns.
Parameters
[in]otherThe source matrix (must differ in at least one dimension).

Definition at line 208 of file mat.hpp.

Member Function Documentation

◆ all_of()

template<std::size_t Rows, std::size_t Cols, class T >
template<std::predicate< T > Pred>
constexpr bool ufo::Mat< Rows, Cols, T >::all_of ( Pred &&  pred) const
inlineconstexprnoexcept

Returns true if all elements satisfy the predicate.

Template Parameters
PredUnary predicate type.
Parameters
[in]predPredicate to apply to each element.
Returns
true iff pred(e) is true for every element e.

Definition at line 454 of file mat.hpp.

◆ any_of()

template<std::size_t Rows, std::size_t Cols, class T >
template<std::predicate< T > Pred>
constexpr bool ufo::Mat< Rows, Cols, T >::any_of ( Pred &&  pred) const
inlineconstexprnoexcept

Returns true if at least one element satisfies the predicate.

Template Parameters
PredUnary predicate type.
Parameters
[in]predPredicate to apply to each element.
Returns
true iff pred(e) is true for at least one element e.

Definition at line 466 of file mat.hpp.

◆ at()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto & ufo::Mat< Rows, Cols, T >::at ( this auto &  self,
size_type  r,
size_type  c 
)
inlineconstexpr

Bounds-checked access to the element at row r, column c.

Parameters
[in]rRow index.
[in]cColumn index.
Returns
Reference to the element (const or non-const, deduced from this).
Exceptions
std::out_of_rangeif r >= Rows or c >= Cols.

Definition at line 254 of file mat.hpp.

◆ begin()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto ufo::Mat< Rows, Cols, T >::begin ( this auto &  self)
inlineconstexprnoexcept

Returns an iterator to the first row.

Returns
Iterator (const or non-const, deduced from this).

Definition at line 290 of file mat.hpp.

◆ block()

template<std::size_t Rows, std::size_t Cols, class T >
template<std::size_t R2>
constexpr auto ufo::Mat< Rows, Cols, T >::block ( std::size_t  start_row,
std::size_t  start_col 
) const -> Mat<R2, R2, T> requires(R2 <= Rows && R2 <= Cols)
inlineconstexprnoexcept

Extracts a square sub-matrix of size R2 × R2 starting at (start_row, start_col).

Template Parameters
R2Size of the square sub-matrix (must satisfy R2 <= Rows and R2 <= Cols).
Parameters
[in]start_rowTop-left row of the block.
[in]start_colTop-left column of the block.
Returns
A Mat<R2, R2, T> containing the extracted block.

Definition at line 433 of file mat.hpp.

◆ col()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr col_type ufo::Mat< Rows, Cols, T >::col ( size_type  c) const
inlineconstexprnoexcept

Returns column c as a Vec<Rows, T> (by value).

Parameters
[in]cColumn index.
Returns
A vector containing all elements in column c.

Definition at line 277 of file mat.hpp.

◆ cols()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr std::size_t ufo::Mat< Rows, Cols, T >::cols ( )
inlinestaticconstexprnoexcept

Returns the number of columns.

Returns
Cols.

Definition at line 320 of file mat.hpp.

◆ conditionNumber()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr T ufo::Mat< Rows, Cols, T >::conditionNumber ( ) const
inlineconstexprnoexcept

Estimates the condition number using the Frobenius norm.

Returns
frobenius_norm() * frobenius_norm(inverse(*this)).

This is a rough approximation; the true condition number uses the spectral (2-)norm.

Definition at line 389 of file mat.hpp.

◆ data()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto ufo::Mat< Rows, Cols, T >::data ( this auto &  self)
inlineconstexprnoexcept

Returns a pointer to the first row.

Returns
Pointer (const or non-const, deduced from this).

Definition at line 305 of file mat.hpp.

◆ end()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto ufo::Mat< Rows, Cols, T >::end ( this auto &  self)
inlineconstexprnoexcept

Returns a past-the-end row iterator.

Returns
Iterator (const or non-const, deduced from this).

Definition at line 299 of file mat.hpp.

◆ explicit() [1/2]

template<std::size_t Rows, std::size_t Cols, class T >
template<class U >
constexpr ufo::Mat< Rows, Cols, T >::explicit ( !std::is_same_v< T, U >  )
constexpr

Converting constructor from a matrix with a different element type.

Template Parameters
USource element type.
Parameters
[in]otherThe source matrix; each element is static_cast to T.

Implicit when U is the same as T; explicit otherwise.

◆ explicit() [2/2]

template<std::size_t Rows, std::size_t Cols, class T >
template<std::convertible_to< T >... Args>
requires (sizeof...(Args) == Rows * Cols)
ufo::Mat< Rows, Cols, T >::explicit ( sizeof...  Args = = 1) const
inlinenoexcept

Constructs a matrix from exactly Rows * Cols element values (row-major).

Template Parameters
ArgsArgument types, each convertible to T.
Parameters
[in]argsElement values in row-major order.

Definition at line 131 of file mat.hpp.

◆ flat_view()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto ufo::Mat< Rows, Cols, T >::flat_view ( this auto &  self)
inlineconstexprnoexcept

Returns a flat std::span<T, Rows * Cols> over all elements (row-major).

Returns
Span of all Rows * Cols elements (const or non-const, deduced from this).

Definition at line 418 of file mat.hpp.

◆ frobenius_norm()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr T ufo::Mat< Rows, Cols, T >::frobenius_norm ( ) const
inlineconstexprnoexcept

Computes the Frobenius norm of the matrix.

Returns
sqrt(sum of squares of all elements).

Definition at line 359 of file mat.hpp.

◆ identity()

template<std::size_t Rows, std::size_t Cols, class T >
static consteval Mat ufo::Mat< Rows, Cols, T >::identity ( )
inlinestaticnoexcept

Returns the identity matrix (square matrices only).

Returns
A matrix with T(1) on the diagonal and T(0) elsewhere.

Definition at line 151 of file mat.hpp.

◆ is_column_major()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr bool ufo::Mat< Rows, Cols, T >::is_column_major ( )
inlinestaticconstexprnoexcept

Returns false (storage is row-major).

Returns
false.

Definition at line 490 of file mat.hpp.

◆ is_row_major()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr bool ufo::Mat< Rows, Cols, T >::is_row_major ( )
inlinestaticconstexprnoexcept

Returns true (storage is row-major).

Returns
true.

Definition at line 496 of file mat.hpp.

◆ isDiagonal()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::isDiagonal ( epsilon = std::numeric_limits<T>::epsilon()) const
inlineconstexprnoexcept

Returns true if all off-diagonal elements are within epsilon of zero.

Parameters
[in]epsilonTolerance (default: numeric_limits<T>::epsilon()).
Returns
true iff the matrix is diagonal (up to epsilon).

Definition at line 512 of file mat.hpp.

◆ isLowerTriangular()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::isLowerTriangular ( epsilon = std::numeric_limits<T>::epsilon()) const
inlineconstexprnoexcept

Returns true if all elements above the main diagonal are within epsilon of zero.

Parameters
[in]epsilonTolerance (default: numeric_limits<T>::epsilon()).
Returns
true iff the matrix is lower triangular (up to epsilon).

Definition at line 571 of file mat.hpp.

◆ isNearZero()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::isNearZero ( epsilon = std::numeric_limits<T>::epsilon() * T(100)) const
inlineconstexprnoexcept

Returns true if the Frobenius norm is less than epsilon.

Parameters
[in]epsilonTolerance (default: 100 * numeric_limits<T>::epsilon()).
Returns
true iff frobenius_norm() < epsilon.

Definition at line 375 of file mat.hpp.

◆ isSymmetric()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::isSymmetric ( epsilon = std::numeric_limits<T>::epsilon()) const
inlineconstexprnoexcept

Returns true if the matrix equals its transpose (within epsilon).

Parameters
[in]epsilonTolerance (default: numeric_limits<T>::epsilon()).
Returns
true iff |M[r][c] - M[c][r]| <= epsilon for all r < c.

Definition at line 531 of file mat.hpp.

◆ isUpperTriangular()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::isUpperTriangular ( epsilon = std::numeric_limits<T>::epsilon()) const
inlineconstexprnoexcept

Returns true if all elements below the main diagonal are within epsilon of zero.

Parameters
[in]epsilonTolerance (default: numeric_limits<T>::epsilon()).
Returns
true iff the matrix is upper triangular (up to epsilon).

Definition at line 551 of file mat.hpp.

◆ memory_footprint()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr std::size_t ufo::Mat< Rows, Cols, T >::memory_footprint ( )
inlinestaticconstexprnoexcept

Returns the size of this matrix type in bytes.

Returns
sizeof(Mat<Rows, Cols, T>).

Definition at line 502 of file mat.hpp.

◆ ones()

template<std::size_t Rows, std::size_t Cols, class T >
static consteval Mat ufo::Mat< Rows, Cols, T >::ones ( )
inlinestaticnoexcept

Returns a matrix with all elements set to T(1).

Returns
A matrix filled with ones.

Definition at line 165 of file mat.hpp.

◆ operator*=() [1/2]

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat & ufo::Mat< Rows, Cols, T >::operator*= ( Mat< Rows, Cols, T > const &  rhs)
inlineconstexprnoexcept

Multiplies this square matrix by rhs (matrix product, square matrices only).

Parameters
[in]rhsRight-hand side matrix.
Returns
Reference to *this.

Definition at line 685 of file mat.hpp.

◆ operator*=() [2/2]

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat & ufo::Mat< Rows, Cols, T >::operator*= ( rhs)
inlineconstexprnoexcept

Multiplies every element by scalar rhs.

Parameters
[in]rhsScalar value.
Returns
Reference to *this.

Definition at line 725 of file mat.hpp.

◆ operator-()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat ufo::Mat< Rows, Cols, T >::operator- ( ) const
inlineconstexprnoexcept

Unary negation operator.

Returns
A matrix with every element negated.

Definition at line 645 of file mat.hpp.

◆ operator-=() [1/2]

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat & ufo::Mat< Rows, Cols, T >::operator-= ( Mat< Rows, Cols, T > const &  rhs)
inlineconstexprnoexcept

Subtracts rhs element-wise from this matrix.

Parameters
[in]rhsRight-hand side matrix.
Returns
Reference to *this.

Definition at line 674 of file mat.hpp.

◆ operator-=() [2/2]

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat & ufo::Mat< Rows, Cols, T >::operator-= ( rhs)
inlineconstexprnoexcept

Subtracts scalar rhs from every element.

Parameters
[in]rhsScalar value.
Returns
Reference to *this.

Definition at line 714 of file mat.hpp.

◆ operator/=()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr Mat & ufo::Mat< Rows, Cols, T >::operator/= ( rhs)
inlineconstexprnoexcept

Divides every element by scalar rhs.

Parameters
[in]rhsScalar value.
Returns
Reference to *this.

Definition at line 736 of file mat.hpp.

◆ operator==()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr bool ufo::Mat< Rows, Cols, T >::operator== ( Mat< Rows, Cols, T > const &  ) const
constexprdefault

Compares two matrices for equality (element-wise).

Parameters
[in]rhsThe matrix to compare against.
Returns
true iff all corresponding elements are equal.

◆ operator[]()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr auto & ufo::Mat< Rows, Cols, T >::operator[] ( this auto &  self,
size_type  i 
)
inlineconstexprnoexcept

Accesses row i as a Vec<Cols, T>.

Parameters
[in]iRow index.
Returns
Reference to the row vector (const or non-const, deduced from this).

Definition at line 242 of file mat.hpp.

◆ rank()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr std::size_t ufo::Mat< Rows, Cols, T >::rank ( epsilon = std::numeric_limits<T>::epsilon() * T(1000)) const
inlineconstexprnoexcept

Estimates the matrix rank via Gaussian elimination.

Parameters
[in]epsilonPivot threshold (default: 1000 * numeric_limits<T>::epsilon()).
Returns
The number of linearly independent rows (up to numerical precision).

Definition at line 591 of file mat.hpp.

◆ row()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr row_type const & ufo::Mat< Rows, Cols, T >::row ( size_type  r) const
inlineconstexprnoexcept

Returns a const reference to row r.

Parameters
[in]rRow index.
Returns
Const reference to the r-th row vector.

Definition at line 267 of file mat.hpp.

◆ rows()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr std::size_t ufo::Mat< Rows, Cols, T >::rows ( )
inlinestaticconstexprnoexcept

Returns the number of rows.

Returns
Rows.

Definition at line 314 of file mat.hpp.

◆ safe_inverse()

template<std::size_t Rows, std::size_t Cols, class T >
constexpr std::optional< Mat > ufo::Mat< Rows, Cols, T >::safe_inverse ( epsilon = std::numeric_limits<T>::epsilon() * T(1000)) const
inlineconstexprnoexcept

Computes the inverse, returning std::nullopt for near-singular matrices.

Parameters
[in]epsilonSingularity threshold (default: 1000 * numeric_limits<T>::epsilon()).
Returns
inverse(*this) if |det| >= epsilon, otherwise std::nullopt.

Definition at line 403 of file mat.hpp.

◆ size()

template<std::size_t Rows, std::size_t Cols, class T >
static constexpr std::size_t ufo::Mat< Rows, Cols, T >::size ( )
inlinestaticconstexprnoexcept

Returns the total number of elements (Rows * Cols).

Returns
Rows * Cols.

Definition at line 326 of file mat.hpp.

◆ transform()

template<std::size_t Rows, std::size_t Cols, class T >
template<class UnaryOp >
constexpr Mat ufo::Mat< Rows, Cols, T >::transform ( UnaryOp &&  op) const
inlineconstexprnoexcept

Applies a unary operation to each element and returns the resulting matrix.

Template Parameters
UnaryOpCallable type mapping T to T.
Parameters
[in]opOperation to apply element-wise.
Returns
A new matrix where each element is op(e).

Definition at line 478 of file mat.hpp.

◆ zeros()

template<std::size_t Rows, std::size_t Cols, class T >
static consteval Mat ufo::Mat< Rows, Cols, T >::zeros ( )
inlinestaticnoexcept

Returns a zero-initialized matrix.

Returns
A matrix with all elements set to T(0).

Definition at line 145 of file mat.hpp.

Member Data Documentation

◆ Cols

template<std::size_t Rows, std::size_t Cols, class T >
constexpr ufo::Mat< Rows, Cols, T >::Cols

Definition at line 194 of file mat.hpp.

◆ fields

template<std::size_t Rows, std::size_t Cols, class T >
std::array<row_type, Rows> ufo::Mat< Rows, Cols, T >::fields {}

Definition at line 119 of file mat.hpp.

◆ noexcept

template<std::size_t Rows, std::size_t Cols, class T >
constexpr U const& other ufo::Mat< Rows, Cols, T >::noexcept
Initial value:
{
std::ranges::transform(other.fields, fields.begin(),
[](auto const& row) { return row_type(row); })
constexpr row_type const & row(size_type r) const noexcept
Returns a const reference to row r.
Definition mat.hpp:267

Definition at line 194 of file mat.hpp.


The documentation for this struct was generated from the following file: