numerics
Loading...
Searching...
No Matches
num::SmallVec< N > Struct Template Reference

Constexpr fixed-size dense vector (stack-allocated). More...

#include <small_matrix.hpp>

Public Member Functions

constexpr realoperator[] (idx i) noexcept
 
constexpr const realoperator[] (idx i) const noexcept
 
constexpr SmallVecoperator+= (const SmallVec &o) noexcept
 
constexpr SmallVecoperator-= (const SmallVec &o) noexcept
 
constexpr SmallVecoperator*= (real s) noexcept
 
constexpr real dot (const SmallVec &o) const noexcept
 
constexpr real norm_sq () const noexcept
 Sum of squares (avoid sqrt to stay constexpr in C++17).
 

Static Public Member Functions

static constexpr idx size () noexcept
 

Public Attributes

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

Detailed Description

template<idx N>
struct num::SmallVec< N >

Constexpr fixed-size dense vector (stack-allocated).

Definition at line 34 of file small_matrix.hpp.

Member Function Documentation

◆ dot()

template<idx N>
constexpr real num::SmallVec< N >::dot ( const SmallVec< N > &  o) const
inlineconstexprnoexcept

Definition at line 54 of file small_matrix.hpp.

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

Referenced by num::SmallVec< N >::norm_sq().

◆ norm_sq()

template<idx N>
constexpr real num::SmallVec< N >::norm_sq ( ) const
inlineconstexprnoexcept

Sum of squares (avoid sqrt to stay constexpr in C++17).

Definition at line 60 of file small_matrix.hpp.

References num::SmallVec< N >::dot().

◆ operator*=()

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

Definition at line 49 of file small_matrix.hpp.

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

◆ operator+=()

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

Definition at line 41 of file small_matrix.hpp.

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

◆ operator-=()

template<idx N>
constexpr SmallVec & num::SmallVec< N >::operator-= ( const SmallVec< N > &  o)
inlineconstexprnoexcept

Definition at line 45 of file small_matrix.hpp.

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

◆ operator[]() [1/2]

template<idx N>
constexpr const real & num::SmallVec< N >::operator[] ( idx  i) const
inlineconstexprnoexcept

Definition at line 38 of file small_matrix.hpp.

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

◆ operator[]() [2/2]

template<idx N>
constexpr real & num::SmallVec< N >::operator[] ( idx  i)
inlineconstexprnoexcept

Definition at line 37 of file small_matrix.hpp.

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

◆ size()

template<idx N>
static constexpr idx num::SmallVec< N >::size ( )
inlinestaticconstexprnoexcept

Definition at line 39 of file small_matrix.hpp.

Member Data Documentation

◆ data


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