Harlinn.Windows 0.1
Loading...
Searching...
No Matches
Harlinn::Math::TupleSimd< TupleT > Class Template Reference

#include <VectorMath.h>

Inheritance diagram for Harlinn::Math::TupleSimd< TupleT >:
[legend]
Collaboration diagram for Harlinn::Math::TupleSimd< TupleT >:
[legend]

Public Types

using TupleType = TupleT
 
using Traits = typename TupleType::Traits
 
using ArrayType = typename TupleType::ArrayType
 
using value_type = typename Traits::Type
 
using size_type = size_t
 
using Simd = typename TupleType::Simd
 
using SIMDType = typename Traits::SIMDType
 

Public Member Functions

 TupleSimd () noexcept
 Sets the elements of simd to zero.
 
 TupleSimd (SIMDType values) noexcept
 Assigns the elements of values to simd.
 
template<SimdType S>
requires std::is_same_v<Traits, typename S::Traits> || ( std::is_same_v<typename Traits::Type, typename S::Traits::Type> && ( Size > S::Size ) )
 TupleSimd (const S &other) noexcept
 Assigns the elements of other.simd to simd.
 
template<SimdType S>
requires std::is_same_v<typename Traits::Type, typename S::Traits::Type> && ( Size < S::Size )
 TupleSimd (const S &other) noexcept
 Assigns the first S::Size elements of other.simd to simd, while initializing the remaining elements to zero.
 
 TupleSimd (const TupleType &other) noexcept
 Loads other.values into simd.
 
 TupleSimd (const ArrayType &values) noexcept
 Loads values into simd.
 
 TupleSimd (value_type x, value_type y) noexcept
 Assigns x to the first element, and y to the second element, of simd&semi; while initializing the remaining elements to zero.
 
 TupleSimd (value_type x, value_type y, value_type z) noexcept
 Assigns x to the first element, y to the second element, and z to the third element, of simd; while initializing the remaining elements to zero.
 
 TupleSimd (value_type x, value_type y, value_type z, value_type w) noexcept
 Assigns x to the first element, y to the second element, z to the third element, and w to the fourth element, of simd; while initializing the remaining elements to zero.
 
 TupleSimd (value_type x) noexcept
 Assigns x to the first two elements of simd.
 
 TupleSimd (value_type x) noexcept
 Assigns x to the first three elements of simd.
 
 TupleSimd (value_type x) noexcept
 Assigns x to the first four elements of simd.
 
 TupleSimd (value_type x) noexcept
 Assigns x to the first eight elements of simd.
 
TupleType Values () const noexcept
 Returns an instance of the Tuple2, Tuple3 or Tuple4 derived type initialized using the Size first elements of simd.
 
TupleSimd operator- () const noexcept
 Returns a TupleSimd with each element of simd negated.
 
bool operator== (const TupleSimd &other) const noexcept
 Returns true if each element of simd is equal to the corresponding element of other.simd, otherwise false.
 
bool operator!= (const TupleSimd &other) const noexcept
 Returns true if any element of simd is not equal to the corresponding element of other.simd, otherwise false.
 
bool operator== (const value_type value) const noexcept
 Returns true if each element of simd is equal to value, otherwise false.
 
bool operator!= (const value_type value) const noexcept
 Returns true if any element of simd is not equal to value, otherwise false.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
bool operator== (const T &other) const noexcept
 Returns true if each element of simd is equal to the corresponding element of other.values, otherwise false.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
bool operator!= (const T &other) const noexcept
 Returns true if any element of simd is not equal to the corresponding element of other.values, otherwise false.
 
bool AnyEqual (const value_type value) const noexcept
 Returns true if any element of simd is equal to value, otherwise false.
 
bool AnyNotEqual (const value_type value) const noexcept
 Returns true if any element of simd is not equal to value, otherwise false.
 
 operator bool () const noexcept
 Returns true if any element of simd is not equal to zero, otherwise false.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimdoperator+= (const T &other) noexcept
 Adds each element of other.values to the corresponding element of simd.
 
TupleSimdoperator+= (const TupleSimd &other) noexcept
 Adds each element of other.simd to the corresponding element of simd.
 
TupleSimdoperator+= (const value_type value) noexcept
 Adds value to each element of simd.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimdoperator-= (const T &other) noexcept
 Subtracts each element of other.values from the corresponding element of simd.
 
TupleSimdoperator-= (const TupleSimd &other) noexcept
 Subtracts each element of other.simd from the corresponding element of simd.
 
TupleSimdoperator-= (const value_type value) noexcept
 Subtracts value from each element of simd.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimdoperator*= (const T &other) noexcept
 Multiplies each element of simd with the corresponding element of other.values.
 
TupleSimdoperator*= (const TupleSimd &other) noexcept
 Multiplies each element of simd with the corresponding element of other.simd.
 
TupleSimdoperator*= (const value_type value) noexcept
 Multiplies each element of simd with value.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimdoperator/= (const T &other) noexcept
 Multiplies each element of simd with the corresponding element of other.values.
 
TupleSimdoperator/= (const TupleSimd &other) noexcept
 Divides each element of simd by the corresponding element of other.simd.
 
TupleSimdoperator/= (const value_type value) noexcept
 Divides each element of simd by value.
 
void Assign (const TupleSimd &other) noexcept
 Assigns each element of other.simd to the corresponding element of simd.
 
void Assign (const value_type value) noexcept
 Assigns value to the first Size elements of simd.
 
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
void Assign (const T &other) noexcept
 Assigns each element of other.values to the corresponding element of simd.
 
void Assign (SIMDType values) noexcept
 Assigns each element of values to the corresponding element of simd.
 
std::string ToString () const
 

Static Public Member Functions

static TupleSimd Backward () noexcept
 Returns true if at least one of the elements of simd` is NaN, otherwise false. /.
 

Public Attributes

SIMDType simd
 

Static Public Attributes

static constexpr size_type Size = TupleType::Size
 
static constexpr size_type Capacity = Traits::SIMDTypeCapacity
 

Friends

std::ostream & operator<< (std::ostream &stream, const TupleSimd &t)
 

Detailed Description

template<typename TupleT>
class Harlinn::Math::TupleSimd< TupleT >

Holds the SIMD value for a Tuple2, Tuple3 or Tuple4.

Most operations on a particular Tuple2, Tuple3 or Tuple4 derived type are implemented using TupleSimd.

Template Parameters
TupleTA Tuple2, Tuple3 or Tuple4 derived type.

The implementation passes TupleSimd objects by reference, since passing the TupleSimd objects by value degraded the performance of pbrto by approximately 10 %.

Member Typedef Documentation

◆ ArrayType

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::ArrayType = typename TupleType::ArrayType

◆ Simd

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::Simd = typename TupleType::Simd

◆ SIMDType

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::SIMDType = typename Traits::SIMDType

◆ size_type

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::size_type = size_t

◆ Traits

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::Traits = typename TupleType::Traits

◆ TupleType

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::TupleType = TupleT

◆ value_type

template<typename TupleT >
using Harlinn::Math::TupleSimd< TupleT >::value_type = typename Traits::Type

Constructor & Destructor Documentation

◆ TupleSimd() [1/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( )
inlinenoexcept

Sets the elements of simd to zero.

◆ TupleSimd() [2/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( SIMDType values)
inlinenoexcept

Assigns the elements of values to simd.

◆ TupleSimd() [3/13]

template<typename TupleT >
template<SimdType S>
requires std::is_same_v<Traits, typename S::Traits> || ( std::is_same_v<typename Traits::Type, typename S::Traits::Type> && ( Size > S::Size ) )
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( const S & other)
inlinenoexcept

Assigns the elements of other.simd to simd.

◆ TupleSimd() [4/13]

template<typename TupleT >
template<SimdType S>
requires std::is_same_v<typename Traits::Type, typename S::Traits::Type> && ( Size < S::Size )
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( const S & other)
inlinenoexcept

Assigns the first S::Size elements of other.simd to simd, while initializing the remaining elements to zero.

◆ TupleSimd() [5/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( const TupleType & other)
inlinenoexcept

Loads other.values into simd.

◆ TupleSimd() [6/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( const ArrayType & values)
inlinenoexcept

Loads values into simd.

◆ TupleSimd() [7/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x,
value_type y )
inlinenoexcept

Assigns x to the first element, and y to the second element, of simd&semi; while initializing the remaining elements to zero.

Can only be called for a TupleSimd type instantiated for a Tuple2 derived type.

◆ TupleSimd() [8/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x,
value_type y,
value_type z )
inlinenoexcept

Assigns x to the first element, y to the second element, and z to the third element, of simd; while initializing the remaining elements to zero.

Can only be called for a TupleSimd type instantiated for a Tuple3 derived type.

◆ TupleSimd() [9/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x,
value_type y,
value_type z,
value_type w )
inlinenoexcept

Assigns x to the first element, y to the second element, z to the third element, and w to the fourth element, of simd; while initializing the remaining elements to zero.

Can only be called for a TupleSimd type instantiated for a Tuple4 derived type.

◆ TupleSimd() [10/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x)
inlineexplicitnoexcept

Assigns x to the first two elements of simd.

◆ TupleSimd() [11/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x)
inlineexplicitnoexcept

Assigns x to the first three elements of simd.

◆ TupleSimd() [12/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x)
inlineexplicitnoexcept

Assigns x to the first four elements of simd.

◆ TupleSimd() [13/13]

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::TupleSimd ( value_type x)
inlineexplicitnoexcept

Assigns x to the first eight elements of simd.

Member Function Documentation

◆ AnyEqual()

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::AnyEqual ( const value_type value) const
inlinenoexcept

Returns true if any element of simd is equal to value, otherwise false.

◆ AnyNotEqual()

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::AnyNotEqual ( const value_type value) const
inlinenoexcept

Returns true if any element of simd is not equal to value, otherwise false.

◆ Assign() [1/4]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
void Harlinn::Math::TupleSimd< TupleT >::Assign ( const T & other)
inlinenoexcept

Assigns each element of other.values to the corresponding element of simd.

◆ Assign() [2/4]

template<typename TupleT >
void Harlinn::Math::TupleSimd< TupleT >::Assign ( const TupleSimd< TupleT > & other)
inlinenoexcept

Assigns each element of other.simd to the corresponding element of simd.

Parameters
other

◆ Assign() [3/4]

template<typename TupleT >
void Harlinn::Math::TupleSimd< TupleT >::Assign ( const value_type value)
inlinenoexcept

Assigns value to the first Size elements of simd.

◆ Assign() [4/4]

template<typename TupleT >
void Harlinn::Math::TupleSimd< TupleT >::Assign ( SIMDType values)
inlinenoexcept

Assigns each element of values to the corresponding element of simd.

◆ Backward()

template<typename TupleT >
static TupleSimd Harlinn::Math::TupleSimd< TupleT >::Backward ( )
inlinestaticnoexcept

Returns true if at least one of the elements of simd` is NaN, otherwise false. /.

bool HasNaN( ) const noexcept { return Traits::HasNaN( simd ); }

/

/ Replicates the first element of simd to all the elements of the result. / TupleSimd X( ) const { return Traits::Trim( Traits::At<0>( simd ) ); } /

/ Extracts the first element of simd. / value_type x( ) const { return Traits::Extract<0>( simd ); } /

/ Assigns the first element of src to the first element of simd. / void SetX( SIMDType src ) { simd = Traits::Permute<4, 1, 2, 3>( simd, src ); } /

/ Assigns the first element of src.simd to the first element of simd. / void SetX( const TupleSimd& src ) { SetX( src.simd ); } /

/ Assigns value to the first element of simd. / void SetX( const value_type value ) { SetX( Traits::Fill<Size>( value ) ); } /

/ Sets the first element of simd to its absolute value. / void AbsX( ) { simd = Traits::AbsX( simd ); } /

/ Copies the TupleSimd setting the first element to its absolute value. / TupleSimd WithAbsX( ) const { return Traits::AbsX( simd ); } /

/ Sets the first element of simd to its negated value. / void NegateX( ) { simd = Traits::NegateX( simd ); } /

/ Copies the TupleSimd setting the first element to its negated value. / TupleSimd WithNegatedX( ) const { return Traits::NegateX( simd ); }

/

/ Replicates the second element of simd to all the elements of the result. / TupleSimd Y( ) const { return Traits::Trim( Traits::At<1>( simd ) ); } /

/ Extracts the second element of simd. / value_type y( ) const { return Traits::Extract<1>( simd ); } /

/ Assigns the second element of src to the second element of simd. / void SetY( SIMDType src ) { simd = Traits::Permute<0, 5, 2, 3>( simd, src ); } /

/ Assigns the second element of src.simd to the second element of simd. / void SetY( const TupleSimd& src ) { SetY( src.simd ); } /

/ Assigns value to the second element of simd. / void SetY( const value_type value ) { SetY( Traits::Fill<Size>( value ) ); } /

/ Sets the second element of simd to its absolute value. / void AbsY( ) { simd = Traits::AbsY( simd ); } /

/ Copies the TupleSimd setting the second element to its absolute value. / TupleSimd WithAbsY( ) const noexcept { return Traits::AbsY( simd ); } /

/ Sets the second element of simd to its negated value. / void NegateY( ) { simd = Traits::NegateY( simd ); } /

/ Copies the TupleSimd setting the second element to its negated value. / TupleSimd WithNegatedY( ) const { return Traits::NegateY( simd ); }

/

/ Sets the first and second elements of simd to their absolute values. / void AbsXY( ) { simd = Traits::AbsXY( simd ); } /

/ Copies the TupleSimd setting the first and second elements to their absolute values. / TupleSimd WithAbsXY( ) const noexcept { return Traits::AbsXY( simd ); } /

/ Sets the first and second elements of simd to their negated values. / void NegateXY( ) { simd = Traits::NegateXY( simd ); } /

/ Copies the TupleSimd setting the first and second elements to their negated values. / TupleSimd WithNegatedXY( ) const { return Traits::NegateXY( simd ); }

/

/ Replicates the third element of simd to all the elements of the result. / TupleSimd Z( ) const requires ( Size > 2 ) { return Traits::Trim( Traits::At<2>( simd ) ); } /

/ Extracts the third element of simd. / value_type z( ) const requires ( Size > 2 ) { return Traits::Extract<2>( simd ); } /

/ Assigns the third element of src to the third element of simd. / void SetZ( SIMDType src ) requires ( Size > 2 ) { simd = Traits::Permute<0, 1, 6, 3>( simd, src ); } /

/ Assigns the third element of src.simd to the third element of simd. / void SetZ( const TupleSimd& src ) requires ( Size > 2 ) { SetZ( src.simd ); } /

/ Assigns value to the third element of simd. / void SetZ( const value_type value ) requires ( Size > 2 ) { SetZ( Traits::Fill<Size>( value ) ); } /

/ Sets the third element of simd to its absolute value. / void AbsZ( ) requires ( Size > 2 ) { simd = Traits::AbsZ( simd ); } /

/ Copies the TupleSimd setting the third element to its absolute value. / TupleSimd WithAbsZ( ) const noexcept requires ( Size > 2 ) { return Traits::AbsZ( simd ); } /

/ Sets the third element of simd to its negated value. / void NegateZ( ) requires ( Size > 2 ) { simd = Traits::NegateZ( simd ); } /

/ Copies the TupleSimd setting the third element to its negated value. / TupleSimd WithNegatedZ( ) const requires ( Size > 2 ) { return Traits::NegateZ( simd ); }

/

/ Assigns the first, second and third elements of src to the first, second and third elements of simd. / void SetXYZ( SIMDType src ) requires ( Size > 2 ) { simd = Traits::Permute<0, 1, 2, 7>( src, simd ); } /

/ Assigns the first, second and third elements of src.simd to the first, second and third elements of simd. / void SetXYZ( const TupleSimd& src ) { SetXYZ( src.simd ); }

/

/ Assigns x to the first element of simd, y to the second element of simd, and z to the third element of simd. / void SetXYZ( const value_type x, const value_type y, const value_type z ) { SetXYZ( Traits::Set( z, y, x ) ); }

/

/ Replicates the fourth element of simd to all the elements of the result. / TupleSimd W( ) const requires ( Size > 3 ) { return Traits::Trim( Traits::At<3>( simd ) ); } /

/ Extracts the fourth element of simd. / value_type w( ) const requires ( Size > 3 ) { return Traits::Extract<3>( simd ); }

/

/ Assigns the fourth element of src to the fourth element of simd. / void SetW( SIMDType src ) requires ( Size > 3 ) { simd = Traits::Permute<0, 1, 2, 7>( simd, src ); } /

/ Assigns the fourth element of src.simd to the fourth element of simd. / void SetW( const TupleSimd& src ) requires ( Size > 3 ) { SetW( src.simd ); } /

/ Assigns value to the fourth element of simd. / void SetW( const value_type value ) requires ( Size > 3 ) { SetW( Traits::Fill<Size>( value ) ); }

/

/ Sets the fourth element of simd to its absolute value. / void AbsW( ) requires ( Size > 3 ) { simd = Traits::AbsW( simd ); } /

/ Copies the TupleSimd setting the fourth element to its absolute value. / TupleSimd WithAbsW( ) const noexcept requires ( Size > 3 ) { return Traits::AbsW( simd ); } /

/ Sets the fourth element of simd to its negated value. / void NegateW( ) requires ( Size > 3 ) { simd = Traits::NegateW( simd ); } /

/ Copies the TupleSimd setting the fourth element to its negated value. / TupleSimd WithNegatedW( ) const requires ( Size > 3 ) { return Traits::NegateW( simd ); }

/

/ Returns the element at index idx in simd. / value_type operator[]( size_t idx ) const { if constexpr ( Size == 1 ) { return Traits::Extract<0>( simd ); } else if constexpr ( Size == 2 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); } } else if constexpr ( Size == 3 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); } } else if constexpr ( Size == 4 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); case 3: return Traits::Extract<3>( simd ); } } else if constexpr ( Size == 5 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); case 3: return Traits::Extract<3>( simd ); case 4: return Traits::Extract<4>( simd ); } } else if constexpr ( Size == 6 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); case 3: return Traits::Extract<3>( simd ); case 4: return Traits::Extract<4>( simd ); case 5: return Traits::Extract<5>( simd ); } } else if constexpr ( Size == 7 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); case 3: return Traits::Extract<3>( simd ); case 4: return Traits::Extract<4>( simd ); case 5: return Traits::Extract<5>( simd ); case 6: return Traits::Extract<6>( simd ); } } else if constexpr ( Size == 8 ) { switch ( idx ) { case 0: return Traits::Extract<0>( simd ); case 1: return Traits::Extract<1>( simd ); case 2: return Traits::Extract<2>( simd ); case 3: return Traits::Extract<3>( simd ); case 4: return Traits::Extract<4>( simd ); case 5: return Traits::Extract<5>( simd ); case 6: return Traits::Extract<6>( simd ); case 7: return Traits::Extract<7>( simd ); } } return operator[]( idx% Size ); }

/

/ Returns a TupleSimd with all elements set to zero. / static TupleSimd Zero( ) noexcept { return TupleSimd( Traits::Zero( ) ); } /

/ Returns a TupleSimd with all elements set to one. / static TupleSimd One( ) noexcept { return TupleSimd( Traits::Fill<Size>( static_cast< value_type >( 1 ) ) ); }

/

/ Returns a TupleSimd the first element set to 1, and the other elements set to 0. / static TupleSimd UnitX( ) noexcept { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ) ) ); } /

/ Returns a TupleSimd the second element set to 1, and the other elements set to 0. / static TupleSimd UnitY( ) noexcept { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ), static_cast< value_type >( 0 ) ) ); }

/

/ Returns a TupleSimd the third element set to 1, and the other elements set to 0. / static TupleSimd UnitZ( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ), static_cast< value_type >( 0 ), static_cast< value_type >( 0 ) ) ); }

/

/ Returns a TupleSimd the fourth element set to 1, and the other elements set to 0. / static TupleSimd UnitW( ) noexcept requires ( Size >= 4 ) { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ), static_cast< value_type >( 0 ), static_cast< value_type >( 0 ), static_cast< value_type >( 0 ) ) ); }

/

/ Returns a TupleSimd containing the unit vector for the up direction. / static TupleSimd Up( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ), static_cast< value_type >( 0 ) ) ); } /

/ Returns a TupleSimd containing the unit vector for the down direction. / static TupleSimd Down( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( -1 ), static_cast< value_type >( 0 ) ) ); } /

/ Returns a TupleSimd containing the unit vector for the right direction. / static TupleSimd Right( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( 1 ) ) ); }

/

/ Returns a TupleSimd containing the unit vector for the left direction. / static TupleSimd Left( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( -1 ) ) ); }

/

/ Returns a TupleSimd containing the unit vector for the forward direction. / static TupleSimd Forward( ) noexcept requires ( Size >= 3 ) { return TupleSimd( Traits::Set( static_cast< value_type >( -1 ), static_cast< value_type >( 0 ), static_cast< value_type >( 0 ) ) ); }

/

/ Returns a TupleSimd containing the unit vector for the backward direction.

◆ operator bool()

template<typename TupleT >
Harlinn::Math::TupleSimd< TupleT >::operator bool ( ) const
inlineexplicitnoexcept

Returns true if any element of simd is not equal to zero, otherwise false.

◆ operator!=() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
bool Harlinn::Math::TupleSimd< TupleT >::operator!= ( const T & other) const
inlinenoexcept

Returns true if any element of simd is not equal to the corresponding element of other.values, otherwise false.

◆ operator!=() [2/3]

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::operator!= ( const TupleSimd< TupleT > & other) const
inlinenoexcept

Returns true if any element of simd is not equal to the corresponding element of other.simd, otherwise false.

◆ operator!=() [3/3]

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::operator!= ( const value_type value) const
inlinenoexcept

Returns true if any element of simd is not equal to value, otherwise false.

◆ operator*=() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator*= ( const T & other)
inlinenoexcept

Multiplies each element of simd with the corresponding element of other.values.

◆ operator*=() [2/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator*= ( const TupleSimd< TupleT > & other)
inlinenoexcept

Multiplies each element of simd with the corresponding element of other.simd.

◆ operator*=() [3/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator*= ( const value_type value)
inlinenoexcept

Multiplies each element of simd with value.

◆ operator+=() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator+= ( const T & other)
inlinenoexcept

Adds each element of other.values to the corresponding element of simd.

◆ operator+=() [2/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator+= ( const TupleSimd< TupleT > & other)
inlinenoexcept

Adds each element of other.simd to the corresponding element of simd.

◆ operator+=() [3/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator+= ( const value_type value)
inlinenoexcept

Adds value to each element of simd.

◆ operator-()

template<typename TupleT >
TupleSimd Harlinn::Math::TupleSimd< TupleT >::operator- ( ) const
inlinenoexcept

Returns a TupleSimd with each element of simd negated.

◆ operator-=() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator-= ( const T & other)
inlinenoexcept

Subtracts each element of other.values from the corresponding element of simd.

◆ operator-=() [2/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator-= ( const TupleSimd< TupleT > & other)
inlinenoexcept

Subtracts each element of other.simd from the corresponding element of simd.

◆ operator-=() [3/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator-= ( const value_type value)
inlinenoexcept

Subtracts value from each element of simd.

◆ operator/=() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator/= ( const T & other)
inlinenoexcept

Multiplies each element of simd with the corresponding element of other.values.

◆ operator/=() [2/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator/= ( const TupleSimd< TupleT > & other)
inlinenoexcept

Divides each element of simd by the corresponding element of other.simd.

◆ operator/=() [3/3]

template<typename TupleT >
TupleSimd & Harlinn::Math::TupleSimd< TupleT >::operator/= ( const value_type value)
inlinenoexcept

Divides each element of simd by value.

◆ operator==() [1/3]

template<typename TupleT >
template<Math::TupleType T>
requires std::is_same_v<Traits, typename T::Traits>
bool Harlinn::Math::TupleSimd< TupleT >::operator== ( const T & other) const
inlinenoexcept

Returns true if each element of simd is equal to the corresponding element of other.values, otherwise false.

◆ operator==() [2/3]

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::operator== ( const TupleSimd< TupleT > & other) const
inlinenoexcept

Returns true if each element of simd is equal to the corresponding element of other.simd, otherwise false.

◆ operator==() [3/3]

template<typename TupleT >
bool Harlinn::Math::TupleSimd< TupleT >::operator== ( const value_type value) const
inlinenoexcept

Returns true if each element of simd is equal to value, otherwise false.

◆ ToString()

template<typename TupleT >
std::string Harlinn::Math::TupleSimd< TupleT >::ToString ( ) const
inline

◆ Values()

template<typename TupleT >
TupleType Harlinn::Math::TupleSimd< TupleT >::Values ( ) const
inlinenoexcept

Returns an instance of the Tuple2, Tuple3 or Tuple4 derived type initialized using the Size first elements of simd.

Friends And Related Symbol Documentation

◆ operator<<

template<typename TupleT >
std::ostream & operator<< ( std::ostream & stream,
const TupleSimd< TupleT > & t )
friend

Member Data Documentation

◆ Capacity

template<typename TupleT >
size_type Harlinn::Math::TupleSimd< TupleT >::Capacity = Traits::SIMDTypeCapacity
staticconstexpr

◆ simd

template<typename TupleT >
SIMDType Harlinn::Math::TupleSimd< TupleT >::simd

◆ Size

template<typename TupleT >
size_type Harlinn::Math::TupleSimd< TupleT >::Size = TupleType::Size
staticconstexpr

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