|
numerics
|
Constexpr fixed-size stack-allocated matrix and Givens rotation. More...
Go to the source code of this file.
Classes | |
| struct | num::SmallVec< N > |
| Constexpr fixed-size dense vector (stack-allocated). More... | |
| struct | num::SmallMatrix< M, N > |
| Constexpr fixed-size row-major matrix (stack-allocated). More... | |
| struct | num::GivensRotation |
| Givens plane rotation: G = [c, s; -s, c]. More... | |
Namespaces | |
| namespace | num |
Functions | |
| template<idx N> | |
| constexpr SmallVec< N > | num::operator+ (SmallVec< N > a, const SmallVec< N > &b) noexcept |
| template<idx N> | |
| constexpr SmallVec< N > | num::operator* (real s, SmallVec< N > v) noexcept |
Constexpr fixed-size stack-allocated matrix and Givens rotation.
These types complement the heap-allocated Matrix / Vector for small inner kernels where heap traffic is undesirable:
SmallVec<N> – constexpr dense vector backed by std::array<real,N> SmallMatrix<M,N> – constexpr row-major matrix backed by std::array<real,M*N> GivensRotation – constexpr (c,s) pair; apply() / apply_t() are branchless
Because these are literal types every operation can be evaluated at compile time (C++17: arithmetic only; C++20+: also sqrt/hypot via constexpr <cmath>). At runtime the compiler places them entirely in registers for small M, N.
Typical uses:
Definition in file small_matrix.hpp.