12template<
typename Derived,
typename T, std::
size_t N>
30 T
dot(
const Derived& rhs)
const;
32 T
absDot(
const Derived& rhs)
const;
46 Derived
safeNormalize(
const Derived& fallback = Derived{})
const;
116 using Base::operator [];
117 using Base::operator ==;
118 using Base::operator !=;
120 using Base::operator +;
121 using Base::operator +=;
122 using Base::operator -;
123 using Base::operator -=;
124 using Base::operator *;
125 using Base::operator *=;
126 using Base::operator /;
127 using Base::operator /=;
140 return Derived{rhs}.sub(lhs);
150 return lhs.rcp().mul(rhs);
Definition TArithmeticArrayBase.h:20
auto begin() noexcept -> typename std::array< T, N >::iterator
Definition TArithmeticArrayBase.ipp:797
Derived exp(U exponent) const
Sets the array to .
bool isZero() const
Definition TArithmeticArrayBase.ipp:549
T sum() const
Definition TArithmeticArrayBase.ipp:336
Derived mul(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:98
Derived pow(U exponent) const
std::array< T, N > m
Definition TArithmeticArrayBase.h:217
Derived sqrt() const
Definition TArithmeticArrayBase.ipp:246
std::vector< T > toVector() const
Definition TArithmeticArrayBase.ipp:842
T avg() const
Definition TArithmeticArrayBase.ipp:342
Derived complement() const
Complements the array's elements. Effectively performing 1 - (*this)[i] for each element.
Definition TArithmeticArrayBase.ipp:502
Derived floor() const
Definition TArithmeticArrayBase.ipp:447
std::array< T, N > toArray() const
Definition TArithmeticArrayBase.ipp:855
T product() const
Definition TArithmeticArrayBase.ipp:358
Derived & sqrtLocal()
Definition TArithmeticArrayBase.ipp:253
Derived & safeClampLocal(T lowerBound, T upperBound)
Definition TArithmeticArrayBase.ipp:307
Derived & expLocal(U exponent)
Derived safeClamp(T lowerBound, T upperBound) const
Clamps current array's elements to specific range. If a floating-point value is non-finite (e....
Definition TArithmeticArrayBase.ipp:300
TSpanView< T, N > toView() const
Definition TArithmeticArrayBase.ipp:869
Derived & divLocal(const Derived &rhs)
Definition TArithmeticArrayBase.ipp:148
Derived & set(T value)
Definition TArithmeticArrayBase.ipp:604
auto end() noexcept -> typename std::array< T, N >::iterator
Definition TArithmeticArrayBase.ipp:811
Derived & absLocal()
Definition TArithmeticArrayBase.ipp:473
Derived clamp(T lowerBound, T upperBound) const
Clamps current array's elements to specific range. None of value, lowerBound and upperBound can be Na...
Definition TArithmeticArrayBase.ipp:264
Derived & addLocal(const Derived &rhs)
Definition TArithmeticArrayBase.ipp:40
Derived lerp(const Derived &rhs, U factor) const
Derived sub(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:62
Derived div(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:134
std::string toString() const
Definition TArithmeticArrayBase.ipp:825
Derived & negateLocal()
Definition TArithmeticArrayBase.ipp:528
Derived & rcpLocal()
Definition TArithmeticArrayBase.ipp:491
T min() const
Definition TArithmeticArrayBase.ipp:364
Derived abs() const
Definition TArithmeticArrayBase.ipp:466
bool isFinite() const
Definition TArithmeticArrayBase.ipp:585
std::size_t maxIndex() const
Definition TArithmeticArrayBase.ipp:414
Derived negate() const
Applies a negative sign to the array's elements. These methods is only defined for signed element typ...
Definition TArithmeticArrayBase.ipp:520
Derived & mulLocal(const Derived &rhs)
Definition TArithmeticArrayBase.ipp:112
TSpan< T, N > toSpan()
Definition TArithmeticArrayBase.ipp:862
bool isNear(const Derived &other, T margin) const
Definition TArithmeticArrayBase.ipp:652
std::size_t minIndex() const
Definition TArithmeticArrayBase.ipp:382
T max() const
Definition TArithmeticArrayBase.ipp:396
bool isNonNegative() const
Definition TArithmeticArrayBase.ipp:565
static constexpr auto NUM_ELEMENTS
Definition TArithmeticArrayBase.h:36
Derived & clampLocal(T lowerBound, T upperBound)
Definition TArithmeticArrayBase.ipp:271
Derived add(const Derived &rhs) const
Definition TArithmeticArrayBase.ipp:26
Derived & subLocal(const Derived &rhs)
Definition TArithmeticArrayBase.ipp:76
constexpr std::size_t size() const noexcept
Number of elements of the array.
Definition TArithmeticArrayBase.ipp:598
bool isEqual(const Derived &other) const
Definition TArithmeticArrayBase.ipp:646
Derived & powLocal(U exponent)
Derived ceil() const
Definition TArithmeticArrayBase.ipp:428
Derived & complementLocal()
Definition TArithmeticArrayBase.ipp:509
Derived rcp() const
Definition TArithmeticArrayBase.ipp:484
Definition TVectorNBase.h:14
friend Derived operator*(const T rhs, const Derived &lhs)
Definition TVectorNBase.h:143
friend Derived operator-(const T rhs, const Derived &lhs)
Definition TVectorNBase.h:138
T length() const
Definition TVectorNBase.ipp:38
PH_DEFINE_INLINE_RULE_OF_5_MEMBERS(TVectorNBase)
friend Derived operator+(const T rhs, const Derived &lhs)
Non-member operators for expressions beginning with a single element value.
Definition TVectorNBase.h:133
Derived & normalizeLocal()
Definition TVectorNBase.ipp:57
T dot(const Derived &rhs) const
Definition TVectorNBase.ipp:14
Derived normalize() const
Normalize the vector. Notice that normalizing a integer typed vector will result in 0-vector most of ...
Definition TVectorNBase.ipp:50
Derived safeNormalize(const Derived &fallback=Derived{}) const
Definition TVectorNBase.ipp:66
T absDot(const Derived &rhs) const
Definition TVectorNBase.ipp:26
T lengthSquared() const
Definition TVectorNBase.ipp:44
std::size_t maxDimension() const
Definition TVectorNBase.ipp:81
friend Derived operator/(const T rhs, const Derived &lhs)
Definition TVectorNBase.h:148
std::size_t minDimension() const
Definition TVectorNBase.ipp:74
Math functions and utilities.
Definition TransformInfo.h:10