numerics
Loading...
Searching...
No Matches
num::SmallMatrix< M, N > Struct Template Reference

Constexpr fixed-size row-major matrix (stack-allocated). More...

#include <small_matrix.hpp>

Public Member Functions

constexpr realoperator() (idx i, idx j) noexcept
 
constexpr const realoperator() (idx i, idx j) const noexcept
 
constexpr void fill (real v) noexcept
 
constexpr SmallMatrix< N, Mtransposed () const noexcept
 
template<idx K>
constexpr SmallMatrix< M, Koperator* (const SmallMatrix< N, K > &B) const noexcept
 Matrix multiplication: (M x N) * (N x K) -> (M x K).
 
constexpr SmallVec< Moperator* (const SmallVec< N > &x) const noexcept
 Matrix-vector product: (MxN) * (N) -> (M).
 
constexpr SmallMatrixoperator+= (const SmallMatrix &o) noexcept
 
constexpr SmallMatrixoperator*= (real s) noexcept
 

Static Public Member Functions

static constexpr idx rows () noexcept
 
static constexpr idx cols () noexcept
 
static constexpr SmallMatrix zeros () noexcept
 
static constexpr SmallMatrix identity () noexcept
 

Public Attributes

std::array< real, M *N > data {}
 

Detailed Description

template<idx M, idx N>
struct num::SmallMatrix< M, N >

Constexpr fixed-size row-major matrix (stack-allocated).

Definition at line 76 of file small_matrix.hpp.

Member Function Documentation

◆ cols()

template<idx M, idx N>
static constexpr idx num::SmallMatrix< M, N >::cols ( )
inlinestaticconstexprnoexcept

Definition at line 83 of file small_matrix.hpp.

◆ fill()

template<idx M, idx N>
constexpr void num::SmallMatrix< M, N >::fill ( real  v)
inlineconstexprnoexcept

Definition at line 85 of file small_matrix.hpp.

References num::SmallMatrix< M, N >::data.

◆ identity()

template<idx M, idx N>
static constexpr SmallMatrix num::SmallMatrix< M, N >::identity ( )
inlinestaticconstexprnoexcept

Definition at line 89 of file small_matrix.hpp.

References num::ipow().

◆ operator()() [1/2]

template<idx M, idx N>
constexpr const real & num::SmallMatrix< M, N >::operator() ( idx  i,
idx  j 
) const
inlineconstexprnoexcept

Definition at line 80 of file small_matrix.hpp.

References num::SmallMatrix< M, N >::data, and num::ipow().

◆ operator()() [2/2]

template<idx M, idx N>
constexpr real & num::SmallMatrix< M, N >::operator() ( idx  i,
idx  j 
)
inlineconstexprnoexcept

Definition at line 79 of file small_matrix.hpp.

References num::SmallMatrix< M, N >::data, and num::ipow().

◆ operator*() [1/2]

template<idx M, idx N>
template<idx K>
constexpr SmallMatrix< M, K > num::SmallMatrix< M, N >::operator* ( const SmallMatrix< N, K > &  B) const
inlineconstexprnoexcept

Matrix multiplication: (M x N) * (N x K) -> (M x K).

Definition at line 106 of file small_matrix.hpp.

References num::ipow().

◆ operator*() [2/2]

template<idx M, idx N>
constexpr SmallVec< M > num::SmallMatrix< M, N >::operator* ( const SmallVec< N > &  x) const
inlineconstexprnoexcept

Matrix-vector product: (MxN) * (N) -> (M).

Definition at line 116 of file small_matrix.hpp.

References num::ipow().

◆ operator*=()

template<idx M, idx N>
constexpr SmallMatrix & num::SmallMatrix< M, N >::operator*= ( real  s)
inlineconstexprnoexcept

Definition at line 128 of file small_matrix.hpp.

References num::SmallMatrix< M, N >::data, and num::ipow().

◆ operator+=()

template<idx M, idx N>
constexpr SmallMatrix & num::SmallMatrix< M, N >::operator+= ( const SmallMatrix< M, N > &  o)
inlineconstexprnoexcept

Definition at line 124 of file small_matrix.hpp.

References num::SmallMatrix< M, N >::data, and num::ipow().

◆ rows()

template<idx M, idx N>
static constexpr idx num::SmallMatrix< M, N >::rows ( )
inlinestaticconstexprnoexcept

Definition at line 82 of file small_matrix.hpp.

References num::ipow().

◆ transposed()

template<idx M, idx N>
constexpr SmallMatrix< N, M > num::SmallMatrix< M, N >::transposed ( ) const
inlineconstexprnoexcept

Definition at line 96 of file small_matrix.hpp.

References num::ipow().

◆ zeros()

template<idx M, idx N>
static constexpr SmallMatrix num::SmallMatrix< M, N >::zeros ( )
inlinestaticconstexprnoexcept

Definition at line 87 of file small_matrix.hpp.

Member Data Documentation

◆ data


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