Vector4< T > Class Template Reference

Represents a four dimensions vector for both CPU and GPU. More...

General Functions

_FCT_CPU_GPU_ int size () const
 
_FCT_CPU_GPU_ Vector4 ()
 
_FCT_CPU_GPU_ Vector4 (const T &t)
 
_FCT_CPU_GPU_ Vector4 (const T *tp)
 
_FCT_CPU_GPU_ Vector4 (const T v0, const T v1, const T v2, const T v3)
 
_FCT_CPU_GPU_ Vector4 (const Vector4< T > &v)
 
_FCT_CPU_GPU_ Vector4 (const Vector4< T > &v, const T d)
 
_FCT_CPU_GPU_ Vector4 (const Vector3< T > &v, const T d=0)
 
_FCT_CPU_GPU_ const T * ptr () const
 
_FCT_CPU_GPU_ Vector4< T > & setValues (const T *b)
 
_FCT_CPU_GPU_ Vector4< T > & operator= (const Vector3< T > &other)
 
_FCT_CPU_GPU_ T & operator[] (int i)
 
_FCT_CPU_GPU_ const T & operator[] (int i) const
 
_FCT_CPU_GPU_ float norm ()
 returns the norm of the vector More...
 
_FCT_CPU_GPU_ float square ()
 returns the squared norm of the vector More...
 
_FCT_CPU_GPU_ float sum ()
 returns the sum of the vector More...
 

Static Functions

static _FCT_CPU_GPU_ float dot (const Vector4< T > &a, const Vector4< T > &b)
 returns the dot product of two vector More...
 
static _FCT_CPU_GPU_ float distance (const Vector4< T > &a, const Vector4< T > &b)
 returns the distance between two vector More...
 

Friends

_FCT_CPU_GPU_ friend Vector4< T > & operator+= (Vector4< T > &itself, T d)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator+= (Vector4< T > &itself, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator-= (Vector4< T > &itself, T d)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator-= (Vector4< T > &itself, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator*= (Vector4< T > &itself, T d)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator*= (Vector4< T > &itself, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator*= (Vector4< T > &itself, const Matrix4f &b)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator/= (Vector4< T > &itself, T d)
 
_FCT_CPU_GPU_ friend Vector4< T > & operator/= (Vector4< T > &itself, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator- (const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator+ (const Vector4< T > &a, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator- (const Vector4< T > &a, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator* (const Vector4< T > &a, T b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator* (T a, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator* (const Vector4< T > &a, const Vector4< T > &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator* (const Vector4< T > &a, const Matrix4f &b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator/ (const Vector4< T > &a, T b)
 
_FCT_CPU_GPU_ friend Vector4< T > operator/ (const Vector4< T > &a, const Vector4< T > &b)
 

Detailed Description

template<typename T>
class sl::Vector4< T >

Represents a four dimensions vector for both CPU and GPU.

Constructor and Destructor

◆ Vector4() [1/7]

_FCT_CPU_GPU_ Vector4 ( )
inline

◆ Vector4() [2/7]

_FCT_CPU_GPU_ Vector4 ( const T &  t)
inline

◆ Vector4() [3/7]

_FCT_CPU_GPU_ Vector4 ( const T *  tp)
inline

◆ Vector4() [4/7]

_FCT_CPU_GPU_ Vector4 ( const T  v0,
const T  v1,
const T  v2,
const T  v3 
)
inline

◆ Vector4() [5/7]

_FCT_CPU_GPU_ Vector4 ( const Vector4< T > &  v)
inline

◆ Vector4() [6/7]

_FCT_CPU_GPU_ Vector4 ( const Vector4< T > &  v,
const T  d 
)
inline

◆ Vector4() [7/7]

_FCT_CPU_GPU_ Vector4 ( const Vector3< T > &  v,
const T  d = 0 
)
inline

Functions

◆ size()

_FCT_CPU_GPU_ int size ( ) const
inline

◆ ptr()

_FCT_CPU_GPU_ const T* ptr ( ) const
inline

◆ setValues()

_FCT_CPU_GPU_ Vector4<T>& setValues ( const T *  b)
inline

◆ operator=()

_FCT_CPU_GPU_ Vector4<T>& operator= ( const Vector3< T > &  other)
inline

◆ operator[]() [1/2]

_FCT_CPU_GPU_ T& operator[] ( int  i)
inline

◆ operator[]() [2/2]

_FCT_CPU_GPU_ const T& operator[] ( int  i) const
inline

◆ norm()

_FCT_CPU_GPU_ float norm ( )
inline

returns the norm of the vector

◆ square()

_FCT_CPU_GPU_ float square ( )
inline

returns the squared norm of the vector

◆ sum()

_FCT_CPU_GPU_ float sum ( )
inline

returns the sum of the vector

◆ dot()

static _FCT_CPU_GPU_ float dot ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
inlinestatic

returns the dot product of two vector

◆ distance()

static _FCT_CPU_GPU_ float distance ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
inlinestatic

returns the distance between two vector

Friends And Related Function Documentation

◆ operator+= [1/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator+= ( Vector4< T > &  itself,
d 
)
friend

◆ operator+= [2/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator+= ( Vector4< T > &  itself,
const Vector4< T > &  b 
)
friend

◆ operator-= [1/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator-= ( Vector4< T > &  itself,
d 
)
friend

◆ operator-= [2/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator-= ( Vector4< T > &  itself,
const Vector4< T > &  b 
)
friend

◆ operator*= [1/3]

_FCT_CPU_GPU_ friend Vector4<T>& operator*= ( Vector4< T > &  itself,
d 
)
friend

◆ operator*= [2/3]

_FCT_CPU_GPU_ friend Vector4<T>& operator*= ( Vector4< T > &  itself,
const Vector4< T > &  b 
)
friend

◆ operator*= [3/3]

_FCT_CPU_GPU_ friend Vector4<T>& operator*= ( Vector4< T > &  itself,
const Matrix4f b 
)
friend

◆ operator/= [1/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator/= ( Vector4< T > &  itself,
d 
)
friend

◆ operator/= [2/2]

_FCT_CPU_GPU_ friend Vector4<T>& operator/= ( Vector4< T > &  itself,
const Vector4< T > &  b 
)
friend

◆ operator- [1/2]

_FCT_CPU_GPU_ friend Vector4<T> operator- ( const Vector4< T > &  b)
friend

◆ operator+

_FCT_CPU_GPU_ friend Vector4<T> operator+ ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
friend

◆ operator- [2/2]

_FCT_CPU_GPU_ friend Vector4<T> operator- ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
friend

◆ operator* [1/4]

_FCT_CPU_GPU_ friend Vector4<T> operator* ( const Vector4< T > &  a,
b 
)
friend

◆ operator* [2/4]

_FCT_CPU_GPU_ friend Vector4<T> operator* ( a,
const Vector4< T > &  b 
)
friend

◆ operator* [3/4]

_FCT_CPU_GPU_ friend Vector4<T> operator* ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
friend

◆ operator* [4/4]

_FCT_CPU_GPU_ friend Vector4<T> operator* ( const Vector4< T > &  a,
const Matrix4f b 
)
friend

◆ operator/ [1/2]

_FCT_CPU_GPU_ friend Vector4<T> operator/ ( const Vector4< T > &  a,
b 
)
friend

◆ operator/ [2/2]

_FCT_CPU_GPU_ friend Vector4<T> operator/ ( const Vector4< T > &  a,
const Vector4< T > &  b 
)
friend