Loading...
Searching...
No Matches
terra::dense::Vec< T, N > Struct Template Reference

#include <vec.hpp>

Public Member Functions

constexpr T & operator() (int i)
 
constexpr const T & operator() (int i) const
 
template<int SliceSize>
constexpr Vec< T, SliceSize > slice (const int start)
 
void fill (const T value)
 
dot (const Vec &other) const
 
constexpr Vec cross (const Vec &other) const
 
constexpr Vec operator+ (const Vec &rhs) const
 
constexpr Vec operator- (const Vec &rhs) const
 
norm () const
 
void normalize ()
 Normalize the vector to unit length in-place.
 
Vec normalized () const
 Return a normalized copy of the vector.
 
Vec inverted_elementwise () const
 

Public Attributes

data [N] = {}
 

Member Function Documentation

◆ cross()

template<typename T , int N>
constexpr Vec terra::dense::Vec< T, N >::cross ( const Vec< T, N > &  other) const
inlineconstexpr

◆ dot()

template<typename T , int N>
T terra::dense::Vec< T, N >::dot ( const Vec< T, N > &  other) const
inline

◆ fill()

template<typename T , int N>
void terra::dense::Vec< T, N >::fill ( const T  value)
inline

◆ inverted_elementwise()

template<typename T , int N>
Vec terra::dense::Vec< T, N >::inverted_elementwise ( ) const
inline

◆ norm()

template<typename T , int N>
T terra::dense::Vec< T, N >::norm ( ) const
inline

◆ normalize()

template<typename T , int N>
void terra::dense::Vec< T, N >::normalize ( )
inline

Normalize the vector to unit length in-place.

◆ normalized()

template<typename T , int N>
Vec terra::dense::Vec< T, N >::normalized ( ) const
inline

Return a normalized copy of the vector.

◆ operator()() [1/2]

template<typename T , int N>
constexpr T & terra::dense::Vec< T, N >::operator() ( int  i)
inlineconstexpr

◆ operator()() [2/2]

template<typename T , int N>
constexpr const T & terra::dense::Vec< T, N >::operator() ( int  i) const
inlineconstexpr

◆ operator+()

template<typename T , int N>
constexpr Vec terra::dense::Vec< T, N >::operator+ ( const Vec< T, N > &  rhs) const
inlineconstexpr

◆ operator-()

template<typename T , int N>
constexpr Vec terra::dense::Vec< T, N >::operator- ( const Vec< T, N > &  rhs) const
inlineconstexpr

◆ slice()

template<typename T , int N>
template<int SliceSize>
constexpr Vec< T, SliceSize > terra::dense::Vec< T, N >::slice ( const int  start)
inlineconstexpr

Member Data Documentation

◆ data

template<typename T , int N>
T terra::dense::Vec< T, N >::data[N] = {}

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