Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::math::TArithmeticArray< T, N > Class Template Referencefinal

#include <TArithmeticArray.h>

Inheritance diagram for ph::math::TArithmeticArray< T, N >:
ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >

Public Member Functions

 TArithmeticArray ()=default
 
 TArithmeticArray (const TArithmeticArray &other)=default
 
 TArithmeticArray (TArithmeticArray &&other)=default
 
TArithmeticArrayoperator= (const TArithmeticArray &rhs)=default
 
TArithmeticArrayoperator= (TArithmeticArray &&rhs)=default
 
 ~TArithmeticArray ()=default
 
template<typename U >
 TArithmeticArray (const TArithmeticArray< U, N > &other)
 
- Public Member Functions inherited from ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >
 TArithmeticArrayBase (T value)
 
 TArithmeticArrayBase (Elements values)
 
auto pow (const U exponent) const -> TArithmeticArray< T, N >
 
auto powLocal (const U exponent) -> TArithmeticArray< T, N > &
 
auto exp (const U exponent) const -> TArithmeticArray< T, N >
 
auto expLocal (const U exponent) -> TArithmeticArray< T, N > &
 
auto lerp (const TArithmeticArray< T, N > &rhs, const U factor) const -> TArithmeticArray< T, N >
 

Additional Inherited Members

- Public Types inherited from ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >
using Elements
 
- Protected Member Functions inherited from ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >
 PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TArithmeticArrayBase)
 
constexpr std::size_t size () const noexcept
 Number of elements of the array.
 
TArithmeticArray< T, N > add (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > add (T rhs) const
 
TArithmeticArray< T, N > & addLocal (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & addLocal (T rhs)
 
TArithmeticArray< T, N > sub (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > sub (T rhs) const
 
TArithmeticArray< T, N > & subLocal (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & subLocal (T rhs)
 
TArithmeticArray< T, N > mul (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > mul (T rhs) const
 
TArithmeticArray< T, N > & mulLocal (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & mulLocal (T rhs)
 
TArithmeticArray< T, N > div (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > div (T rhs) const
 
TArithmeticArray< T, N > & divLocal (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & divLocal (T rhs)
 
TArithmeticArray< T, N > pow (U exponent) const
 
TArithmeticArray< T, N > pow (const TArithmeticArray< T, N > &exponent) const
 
TArithmeticArray< T, N > & powLocal (U exponent)
 
TArithmeticArray< T, N > & powLocal (const TArithmeticArray< T, N > &exponent)
 
TArithmeticArray< T, N > sqrt () const
 
TArithmeticArray< T, N > & sqrtLocal ()
 
TArithmeticArray< T, N > abs () const
 
TArithmeticArray< T, N > & absLocal ()
 
TArithmeticArray< T, N > rcp () const
 
TArithmeticArray< T, N > & rcpLocal ()
 
sum () const
 
avg () const
 
product () const
 
min () const
 
TArithmeticArray< T, N > min (const TArithmeticArray< T, N > &other) const
 
std::size_t minIndex () const
 
max () const
 
TArithmeticArray< T, N > max (const TArithmeticArray< T, N > &other) const
 
std::size_t maxIndex () const
 
TArithmeticArray< T, N > ceil () const
 
TArithmeticArray< T, N > floor () const
 
TArithmeticArray< T, N > lerp (const TArithmeticArray< T, N > &rhs, U factor) const
 
bool isZero () const
 
bool isNonNegative () const
 
bool isFinite () const
 
TArithmeticArray< T, N > & set (T value)
 
TArithmeticArray< T, N > & set (std::size_t index, T value)
 
TArithmeticArray< T, N > & set (const std::array< T, N > &values)
 
T & operator[] (std::size_t index)
 
const T & operator[] (std::size_t index) const
 
bool isEqual (const TArithmeticArray< T, N > &other) const
 
bool isNear (const TArithmeticArray< T, N > &other, T margin) const
 
bool operator== (const TArithmeticArray< T, N > &other) const
 
bool operator!= (const TArithmeticArray< T, N > &other) const
 
TArithmeticArray< T, N > operator+ (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > operator+ (T rhs) const
 
TArithmeticArray< T, N > operator- (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > operator- (T rhs) const
 
TArithmeticArray< T, N > operator- () const
 
TArithmeticArray< T, N > operator* (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > operator* (T rhs) const
 
TArithmeticArray< T, N > operator/ (const TArithmeticArray< T, N > &rhs) const
 
TArithmeticArray< T, N > operator/ (T rhs) const
 
TArithmeticArray< T, N > & operator+= (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & operator+= (T rhs)
 
TArithmeticArray< T, N > & operator-= (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & operator-= (T rhs)
 
TArithmeticArray< T, N > & operator*= (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & operator*= (T rhs)
 
TArithmeticArray< T, N > & operator/= (const TArithmeticArray< T, N > &rhs)
 
TArithmeticArray< T, N > & operator/= (T rhs)
 
auto begin () noexcept -> typename std::array< T, N >::iterator
 
auto begin () const noexcept -> typename std::array< T, N >::const_iterator
 
auto end () noexcept -> typename std::array< T, N >::iterator
 
auto end () const noexcept -> typename std::array< T, N >::const_iterator
 
std::string toString () const
 
std::vector< T > toVector () const
 
std::array< T, N > toArray () const
 
TSpan< T, N > toSpan ()
 
TSpanView< T, N > toView () const
 
TArithmeticArray< T, N > exp (U exponent) const
 Sets the array to \( e^exponent \).
 
TArithmeticArray< T, N > & expLocal (U exponent)
 
TArithmeticArray< T, N > exp (const TArithmeticArray< T, N > &exponent) const
 Sets the array to \( e^{exponent_i} \).
 
TArithmeticArray< T, N > & expLocal (const TArithmeticArray< T, N > &exponent)
 
TArithmeticArray< T, N > clamp (T lowerBound, T upperBound) const
 Clamps current array's elements to specific range. None of value, lowerBound and upperBound can be NaN, or the method's behavior is undefined.
 
TArithmeticArray< T, N > clamp (const TArithmeticArray< T, N > &lowerBound, const TArithmeticArray< T, N > &upperBound) const
 
TArithmeticArray< T, N > & clampLocal (T lowerBound, T upperBound)
 
TArithmeticArray< T, N > & clampLocal (const TArithmeticArray< T, N > &lowerBound, const TArithmeticArray< T, N > &upperBound)
 
TArithmeticArray< T, N > safeClamp (T lowerBound, T upperBound) const
 Clamps current array's elements to specific range. If a floating-point value is non-finite (e.g., being Inf, NaN), its value is clamped to lowerBound. Neither lowerBound nor upperBound can be NaN, or the method's behavior is undefined.
 
TArithmeticArray< T, N > safeClamp (const TArithmeticArray< T, N > &lowerBound, const TArithmeticArray< T, N > &upperBound) const
 
TArithmeticArray< T, N > & safeClampLocal (T lowerBound, T upperBound)
 
TArithmeticArray< T, N > & safeClampLocal (const TArithmeticArray< T, N > &lowerBound, const TArithmeticArray< T, N > &upperBound)
 
TArithmeticArray< T, N > complement () const
 Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
 
TArithmeticArray< T, N > & complementLocal ()
 
TArithmeticArray< T, N > negate () const
 Applies a negative sign to the array's elements. These methods is only defined for signed element types.
 
TArithmeticArray< T, N > & negateLocal ()
 
- Protected Attributes inherited from ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >
std::array< T, N > m
 
- Static Protected Attributes inherited from ph::math::TArithmeticArrayBase< TArithmeticArray< T, N >, T, N >
static constexpr auto NUM_ELEMENTS
 

Constructor & Destructor Documentation

◆ TArithmeticArray() [1/4]

template<typename T , std::size_t N>
ph::math::TArithmeticArray< T, N >::TArithmeticArray ( )
inlinedefault

◆ TArithmeticArray() [2/4]

template<typename T , std::size_t N>
ph::math::TArithmeticArray< T, N >::TArithmeticArray ( const TArithmeticArray< T, N > & other)
inlinedefault

◆ TArithmeticArray() [3/4]

template<typename T , std::size_t N>
ph::math::TArithmeticArray< T, N >::TArithmeticArray ( TArithmeticArray< T, N > && other)
inlinedefault

◆ ~TArithmeticArray()

template<typename T , std::size_t N>
ph::math::TArithmeticArray< T, N >::~TArithmeticArray ( )
inlinedefault

◆ TArithmeticArray() [4/4]

template<typename T , std::size_t N>
template<typename U >
ph::math::TArithmeticArray< T, N >::TArithmeticArray ( const TArithmeticArray< U, N > & other)
inlineexplicit

Member Function Documentation

◆ operator=() [1/2]

template<typename T , std::size_t N>
TArithmeticArray & ph::math::TArithmeticArray< T, N >::operator= ( const TArithmeticArray< T, N > & rhs)
inlinedefault

◆ operator=() [2/2]

template<typename T , std::size_t N>
TArithmeticArray & ph::math::TArithmeticArray< T, N >::operator= ( TArithmeticArray< T, N > && rhs)
inlinedefault

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