Vector2< T > Class Template Reference

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

Functions

_FCT_CPU_GPU_ int size () const
 
_FCT_CPU_GPU_ Vector2 ()
 
_FCT_CPU_GPU_ Vector2 (const T &t)
 
_FCT_CPU_GPU_ Vector2 (const T *tp)
 
_FCT_CPU_GPU_ Vector2 (const T v0, const T v1)
 
_FCT_CPU_GPU_ Vector2 (const Vector2< T > &v)
 
_FCT_CPU_GPU_ const T * ptr () const
 
_FCT_CPU_GPU_ Vector2setValues (const T *b)
 
_FCT_CPU_GPU_ T & operator[] (int i)
 
_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 Vector2< T > &a, const Vector2< T > &b)
 returns the dot product of two vector More...
 
static _FCT_CPU_GPU_ float distance (const Vector2< T > &a, const Vector2< T > &b)
 returns the distance between two vector More...
 

Detailed Description

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

Represents a two dimensions vector for both CPU and GPU.

Constructor and Destructor

◆ Vector2() [1/5]

_FCT_CPU_GPU_ Vector2 ( )
inline

◆ Vector2() [2/5]

_FCT_CPU_GPU_ Vector2 ( const T &  t)
inline

◆ Vector2() [3/5]

_FCT_CPU_GPU_ Vector2 ( const T *  tp)
inline

◆ Vector2() [4/5]

_FCT_CPU_GPU_ Vector2 ( const T  v0,
const T  v1 
)
inline

◆ Vector2() [5/5]

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

Functions

◆ size()

_FCT_CPU_GPU_ int size ( ) const
inline

◆ ptr()

_FCT_CPU_GPU_ const T* ptr ( ) const
inline

◆ setValues()

_FCT_CPU_GPU_ Vector2& setValues ( const T *  b)
inline

◆ operator[]()

_FCT_CPU_GPU_ T& operator[] ( int  i)
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 Vector2< T > &  a,
const Vector2< T > &  b 
)
inlinestatic

returns the dot product of two vector

◆ distance()

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

returns the distance between two vector