Class representing a 2-dimensional vector for both CPU and GPU. More...
Functions | |
_FCT_CPU_GPU_ int | size () const |
Return the size of the sl::Vector2. More... | |
_FCT_CPU_GPU_ | Vector2 () |
Default constructor. More... | |
_FCT_CPU_GPU_ | Vector2 (const T &t) |
Constructor. More... | |
_FCT_CPU_GPU_ | Vector2 (const T *tp) |
Constructor. More... | |
_FCT_CPU_GPU_ | Vector2 (const T v0, const T v1) |
Constructor. More... | |
_FCT_CPU_GPU_ | Vector2 (const Vector2< T > &v) |
Copy constructor. More... | |
_FCT_CPU_GPU_ const T * | ptr () const |
Returns a pointer of the first component. More... | |
_FCT_CPU_GPU_ Vector2 & | setValues (const T *b) |
Sets the components of the sl::Vector2 to the values of the argument. More... | |
_FCT_CPU_GPU_ T & | operator[] (int i) |
Returns the i-th component. More... | |
_FCT_CPU_GPU_ float | norm () |
Returns the norm of the sl::Vector2. More... | |
_FCT_CPU_GPU_ float | square () |
Returns the squared norm of the sl::Vector2. More... | |
_FCT_CPU_GPU_ float | sum () |
Returns the sum of the components of the sl::Vector2. More... | |
Static Functions | |
static _FCT_CPU_GPU_ float | dot (const Vector2< T > &a, const Vector2< T > &b) |
Returns the dot product of two sl::Vector2. More... | |
static _FCT_CPU_GPU_ float | distance (const Vector2< T > &a, const Vector2< T > &b) |
Returns the distance between two sl::Vector2. More... | |
Class representing a 2-dimensional vector for both CPU and GPU.
|
inline |
Default constructor.
Initialize the sl::Vector2 to 0.
|
inline |
Constructor.
Initialize the sl::Vector2 to ( t, t ).
|
inline |
Constructor.
Initialize the sl::Vector2 with the component of the argument.
|
inline |
Constructor.
Initialize the sl::Vector2 to ( v0, v1 ).
Copy constructor.
Initialize the sl::Vector2 by copying another sl::Vector2.
|
inline |
Return the size of the sl::Vector2.
|
inline |
Returns a pointer of the first component.
|
inline |
Sets the components of the sl::Vector2 to the values of the argument.
|
inline |
Returns the i-th component.
|
inline |
Returns the norm of the sl::Vector2.
|
inline |
Returns the squared norm of the sl::Vector2.
|
inline |
Returns the sum of the components of the sl::Vector2.
Returns the dot product of two sl::Vector2.
Returns the distance between two sl::Vector2.