Fx2D
A C++20 2D rigid-body physics engine
Loading...
Searching...
No Matches
FxArray< T > Class Template Reference

Fixed-size, aligned value array. More...

#include <Math.h>

Public Member Functions

 FxArray ()
 FxArray (std::size_t n)
 FxArray (std::initializer_list< T > init)
 FxArray (std::vector< T > const &v)
template<std::size_t N>
 FxArray (T const (&arr)[N])
 FxArray (FxArray const &o)
 FxArray (FxArray &&) noexcept=default
 ~FxArray ()=default
FxArray & operator= (FxArray const &o)
FxArray & operator= (std::vector< T > const &v)
FxArray & operator= (std::initializer_list< T > init)
FxArray & operator= (FxArray &&) noexcept=default
T * aligned_data () noexcept
T const * aligned_data () const noexcept
T & operator[] (size_t i) noexcept
T const & operator[] (size_t i) const noexcept
template<std::integral I>
T & operator() (I i) noexcept
template<std::integral I>
T const & operator() (I i) const noexcept
template<std::integral I>
T & at (I idx)
template<std::integral I>
T const & at (I idx) const
T * begin () noexcept
T const * begin () const noexcept
T * end () noexcept
T const * end () const noexcept
size_t size () const noexcept
bool empty () const noexcept
T * data () noexcept
T const * data () const noexcept
void swap (FxArray &o) noexcept
template<typename U>
requires (Numeric<T> && Numeric<U>)
FxArray< U > as () const
template<typename Compare>
T min (Compare cmp) const
template<typename Compare>
T max (Compare cmp) const
T min () const
T max () const
template<typename Compare>
std::pair< std::size_t, T > argmin (Compare cmp) const
template<typename Compare>
std::pair< std::size_t, T > argmax (Compare cmp) const
std::pair< std::size_t, T > argmin () const
std::pair< std::size_t, T > argmax () const
T mean () const
float meanf () const
float stddev () const
FxArray operator- () const
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator+= (U const &v)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator-= (U const &v)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator*= (U const &v)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator/= (U const &v)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator+= (FxArray< U > const &o)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator-= (FxArray< U > const &o)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator*= (FxArray< U > const &o)
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & operator/= (FxArray< U > const &o)
FxArray< float > dot (T const &v) const
FxArray< float > dot (FxArray< T > const &o) const
FxArray & rotate_inplace_rad (float theta_rad) noexcept
FxArray & rotate_inplace (float degrees) noexcept
FxArray & perp_inplace () noexcept
FxArray perp () const
FxArray rotate_rad (float theta_rad) const
FxArray rotate (float degrees) const
FxArray< float > bounds () const

Protected Member Functions

template<std::integral I>
std::size_t checkIndex (I idx) const
void throw_if_empty (char const *what) const
void throw_if_size_mismatch (char const *what, size_t o_size) const
template<typename Compare>
std::pair< std::size_t, T > best_pair (Compare cmp, const char *name) const

Detailed Description

template<NumericOrFxVec T>
class FxArray< T >

Fixed-size, aligned value array.

Definition at line 638 of file Math.h.

Constructor & Destructor Documentation

◆ FxArray() [1/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( )
inline

Definition at line 687 of file Math.h.

◆ FxArray() [2/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( std::size_t n)
inlineexplicit

Definition at line 689 of file Math.h.

◆ FxArray() [3/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( std::initializer_list< T > init)
inline

Definition at line 692 of file Math.h.

◆ FxArray() [4/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( std::vector< T > const & v)
inline

Definition at line 697 of file Math.h.

◆ FxArray() [5/7]

template<NumericOrFxVec T>
template<std::size_t N>
FxArray< T >::FxArray ( T const (&) arr[N])
inline

Definition at line 703 of file Math.h.

◆ FxArray() [6/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( FxArray< T > const & o)
inline

Definition at line 708 of file Math.h.

◆ FxArray() [7/7]

template<NumericOrFxVec T>
FxArray< T >::FxArray ( FxArray< T > && )
defaultnoexcept

◆ ~FxArray()

template<NumericOrFxVec T>
FxArray< T >::~FxArray ( )
default

Member Function Documentation

◆ aligned_data() [1/2]

template<NumericOrFxVec T>
T const * FxArray< T >::aligned_data ( ) const
inlinenoexcept

Definition at line 745 of file Math.h.

◆ aligned_data() [2/2]

template<NumericOrFxVec T>
T * FxArray< T >::aligned_data ( )
inlinenoexcept

Definition at line 744 of file Math.h.

◆ argmax() [1/2]

template<NumericOrFxVec T>
std::pair< std::size_t, T > FxArray< T >::argmax ( ) const
inline

Definition at line 826 of file Math.h.

◆ argmax() [2/2]

template<NumericOrFxVec T>
template<typename Compare>
std::pair< std::size_t, T > FxArray< T >::argmax ( Compare cmp) const
inline

Definition at line 820 of file Math.h.

◆ argmin() [1/2]

template<NumericOrFxVec T>
std::pair< std::size_t, T > FxArray< T >::argmin ( ) const
inline

Definition at line 825 of file Math.h.

◆ argmin() [2/2]

template<NumericOrFxVec T>
template<typename Compare>
std::pair< std::size_t, T > FxArray< T >::argmin ( Compare cmp) const
inline

Definition at line 815 of file Math.h.

◆ as()

template<NumericOrFxVec T>
template<typename U>
requires (Numeric<T> && Numeric<U>)
FxArray< U > FxArray< T >::as ( ) const
inline

Definition at line 790 of file Math.h.

◆ at() [1/2]

template<NumericOrFxVec T>
template<std::integral I>
T & FxArray< T >::at ( I idx)
inline

Definition at line 763 of file Math.h.

◆ at() [2/2]

template<NumericOrFxVec T>
template<std::integral I>
T const & FxArray< T >::at ( I idx) const
inline

Definition at line 767 of file Math.h.

◆ begin() [1/2]

template<NumericOrFxVec T>
T const * FxArray< T >::begin ( ) const
inlinenoexcept

Definition at line 773 of file Math.h.

◆ begin() [2/2]

template<NumericOrFxVec T>
T * FxArray< T >::begin ( )
inlinenoexcept

Definition at line 772 of file Math.h.

◆ best_pair()

template<NumericOrFxVec T>
template<typename Compare>
std::pair< std::size_t, T > FxArray< T >::best_pair ( Compare cmp,
const char * name ) const
inlineprotected

Definition at line 671 of file Math.h.

◆ bounds()

template<NumericOrFxVec T>
FxArray< float > FxArray< T >::bounds ( ) const
inline

Definition at line 1047 of file Math.h.

◆ checkIndex()

template<NumericOrFxVec T>
template<std::integral I>
std::size_t FxArray< T >::checkIndex ( I idx) const
inlineprotected

Definition at line 647 of file Math.h.

◆ data() [1/2]

template<NumericOrFxVec T>
T const * FxArray< T >::data ( ) const
inlinenoexcept

Definition at line 781 of file Math.h.

◆ data() [2/2]

template<NumericOrFxVec T>
T * FxArray< T >::data ( )
inlinenoexcept

Definition at line 780 of file Math.h.

◆ dot() [1/2]

template<NumericOrFxVec T>
FxArray< float > FxArray< T >::dot ( FxArray< T > const & o) const
inline

Definition at line 974 of file Math.h.

◆ dot() [2/2]

template<NumericOrFxVec T>
FxArray< float > FxArray< T >::dot ( T const & v) const
inline

Definition at line 962 of file Math.h.

◆ empty()

template<NumericOrFxVec T>
bool FxArray< T >::empty ( ) const
inlinenoexcept

Definition at line 779 of file Math.h.

◆ end() [1/2]

template<NumericOrFxVec T>
T const * FxArray< T >::end ( ) const
inlinenoexcept

Definition at line 775 of file Math.h.

◆ end() [2/2]

template<NumericOrFxVec T>
T * FxArray< T >::end ( )
inlinenoexcept

Definition at line 774 of file Math.h.

◆ max() [1/2]

template<NumericOrFxVec T>
T FxArray< T >::max ( ) const
inline

Definition at line 811 of file Math.h.

◆ max() [2/2]

template<NumericOrFxVec T>
template<typename Compare>
T FxArray< T >::max ( Compare cmp) const
inline

Definition at line 805 of file Math.h.

◆ mean()

template<NumericOrFxVec T>
T FxArray< T >::mean ( ) const
inline

Definition at line 829 of file Math.h.

◆ meanf()

template<NumericOrFxVec T>
float FxArray< T >::meanf ( ) const
inline

Definition at line 839 of file Math.h.

◆ min() [1/2]

template<NumericOrFxVec T>
T FxArray< T >::min ( ) const
inline

Definition at line 810 of file Math.h.

◆ min() [2/2]

template<NumericOrFxVec T>
template<typename Compare>
T FxArray< T >::min ( Compare cmp) const
inline

Definition at line 800 of file Math.h.

◆ operator()() [1/2]

template<NumericOrFxVec T>
template<std::integral I>
T const & FxArray< T >::operator() ( I i) const
inlinenoexcept

Definition at line 757 of file Math.h.

◆ operator()() [2/2]

template<NumericOrFxVec T>
template<std::integral I>
T & FxArray< T >::operator() ( I i)
inlinenoexcept

Definition at line 752 of file Math.h.

◆ operator*=() [1/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator*= ( FxArray< U > const & o)
inline

Definition at line 941 of file Math.h.

◆ operator*=() [2/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator*= ( U const & v)
inline

Definition at line 898 of file Math.h.

◆ operator+=() [1/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator+= ( FxArray< U > const & o)
inline

Definition at line 919 of file Math.h.

◆ operator+=() [2/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator+= ( U const & v)
inline

Definition at line 878 of file Math.h.

◆ operator-()

template<NumericOrFxVec T>
FxArray FxArray< T >::operator- ( ) const
inline

Definition at line 866 of file Math.h.

◆ operator-=() [1/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator-= ( FxArray< U > const & o)
inline

Definition at line 930 of file Math.h.

◆ operator-=() [2/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator-= ( U const & v)
inline

Definition at line 888 of file Math.h.

◆ operator/=() [1/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator/= ( FxArray< U > const & o)
inline

Definition at line 952 of file Math.h.

◆ operator/=() [2/2]

template<NumericOrFxVec T>
template<typename U>
requires ConvertibleOrNumeric<U, T>
FxArray & FxArray< T >::operator/= ( U const & v)
inline

Definition at line 908 of file Math.h.

◆ operator=() [1/4]

template<NumericOrFxVec T>
FxArray & FxArray< T >::operator= ( FxArray< T > && )
defaultnoexcept

◆ operator=() [2/4]

template<NumericOrFxVec T>
FxArray & FxArray< T >::operator= ( FxArray< T > const & o)
inline

Definition at line 719 of file Math.h.

◆ operator=() [3/4]

template<NumericOrFxVec T>
FxArray & FxArray< T >::operator= ( std::initializer_list< T > init)
inline

Definition at line 735 of file Math.h.

◆ operator=() [4/4]

template<NumericOrFxVec T>
FxArray & FxArray< T >::operator= ( std::vector< T > const & v)
inline

Definition at line 727 of file Math.h.

◆ operator[]() [1/2]

template<NumericOrFxVec T>
T const & FxArray< T >::operator[] ( size_t i) const
inlinenoexcept

Definition at line 749 of file Math.h.

◆ operator[]() [2/2]

template<NumericOrFxVec T>
T & FxArray< T >::operator[] ( size_t i)
inlinenoexcept

Definition at line 748 of file Math.h.

◆ perp()

template<NumericOrFxVec T>
FxArray FxArray< T >::perp ( ) const
inline

Definition at line 1021 of file Math.h.

◆ perp_inplace()

template<NumericOrFxVec T>
FxArray & FxArray< T >::perp_inplace ( )
inlinenoexcept

Definition at line 1011 of file Math.h.

◆ rotate()

template<NumericOrFxVec T>
FxArray FxArray< T >::rotate ( float degrees) const
inline

Definition at line 1039 of file Math.h.

◆ rotate_inplace()

template<NumericOrFxVec T>
FxArray & FxArray< T >::rotate_inplace ( float degrees)
inlinenoexcept

Definition at line 1003 of file Math.h.

◆ rotate_inplace_rad()

template<NumericOrFxVec T>
FxArray & FxArray< T >::rotate_inplace_rad ( float theta_rad)
inlinenoexcept

Definition at line 988 of file Math.h.

◆ rotate_rad()

template<NumericOrFxVec T>
FxArray FxArray< T >::rotate_rad ( float theta_rad) const
inline

Definition at line 1030 of file Math.h.

◆ size()

template<NumericOrFxVec T>
size_t FxArray< T >::size ( ) const
inlinenoexcept

Definition at line 778 of file Math.h.

◆ stddev()

template<NumericOrFxVec T>
float FxArray< T >::stddev ( ) const
inline

Definition at line 851 of file Math.h.

◆ swap()

template<NumericOrFxVec T>
void FxArray< T >::swap ( FxArray< T > & o)
inlinenoexcept

Definition at line 783 of file Math.h.

◆ throw_if_empty()

template<NumericOrFxVec T>
void FxArray< T >::throw_if_empty ( char const * what) const
inlineprotected

Definition at line 658 of file Math.h.

◆ throw_if_size_mismatch()

template<NumericOrFxVec T>
void FxArray< T >::throw_if_size_mismatch ( char const * what,
size_t o_size ) const
inlineprotected

Definition at line 664 of file Math.h.


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