|
CU_HOST_DEVICE | Vector (const Vector &vec) |
| Copy another vector.
|
|
template<class T1 > |
CU_HOST_DEVICE | Vector (const Vector< dim, T1 > &vec) |
| Copy another vector with different number of elements.
|
|
template<size_t d1, class T1 > |
CU_HOST_DEVICE | Vector (const Vector< d1, T1 > &vec) |
| Copy another vector with different number of elements.
|
|
template<class Vec > |
CU_HOST_DEVICE | Vector (const Vec &el) |
| Initialize a vector from any object behaving like an array. More...
|
|
CU_HOST_DEVICE | Vector (const T &x=T()) |
| Initialize a vector with all values to x .
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y) |
| Initialize a 2D vector.
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y, const T &z) |
| Initialize a 3D vector.
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y, const T &z, const T &t) |
| Initialize a 4D vector.
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y, const T &z, const T &a, const T &b) |
| Initialize a 5D vector.
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y, const T &z, const T &a, const T &b, const T &c) |
| Initialize a 6D vector.
|
|
CU_HOST_DEVICE | Vector (const T &x, const T &y, const T &z, const T &a, const T &b, const T &c, const T &d) |
| Initialize a 7D vector.
|
|
CU_HOST_DEVICE | Vector (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g, const T &h, const T &i, const T &j, const T &k, const T &l) |
| Initialize a 12D vector.
|
|
CU_HOST_DEVICE T * | data () |
| Returns a raw pointer on the data.
|
|
CU_HOST_DEVICE iterator | begin () |
| STL-iteration begin.
|
|
CU_HOST_DEVICE const_iterator | begin () const |
| Stl-iteration constant begin.
|
|
CU_HOST_DEVICE iterator | end () |
| STL-iteration end.
|
|
CU_HOST_DEVICE const_iterator | end () const |
| Stl-iteration constant end.
|
|
CU_HOST_DEVICE const T * | c_data () const |
| Returns a constant raw pointer on the data.
|
|
CU_HOST_DEVICE Vector | operator- (void) const |
| Vector negation.
|
|
CU_HOST_DEVICE Vector | operator+ (const Vector &vec) const |
| Vector addition.
|
|
CU_HOST_DEVICE Vector | operator- (const Vector &vec) const |
| Vector subtraction.
|
|
CU_HOST_DEVICE Vector | mult (const Vector &vec) const |
| Element-wise multiplcation.
|
|
CU_HOST_DEVICE Vector | operator* (const T &scalar) const |
| Multiplication by a scalar.
|
|
CU_HOST_DEVICE Vector | operator/ (const T &scalar) const |
| Division by a scalar.
|
|
CU_HOST_DEVICE Vector | operator/ (const Vector &vec) const |
| Element-wise division.
|
|
CU_HOST_DEVICE Vector & | operator/= (const Vector &vec) |
| In-place element-wise division by a scalar.
|
|
CU_HOST_DEVICE T | operator* (const Vector &vec) const |
| Dot product.
|
|
CU_HOST_DEVICE Vector & | operator= (const Vector &vec) |
| Vector copy.
|
|
CU_HOST_DEVICE Vector & | operator+= (const Vector &vec) |
| In-place vector addition.
|
|
CU_HOST_DEVICE Vector & | operator+= (const T &val) |
| In-place constant addition.
|
|
CU_HOST_DEVICE Vector & | operator-= (const Vector &vec) |
| In-place vector subtraction.
|
|
CU_HOST_DEVICE Vector & | operator-= (const T &val) |
| In-place value subtraction.
|
|
CU_HOST_DEVICE Vector & | operator*= (const T &scalar) |
| In-place multiplication by a scalar.
|
|
template<typename T1 > |
CU_HOST_DEVICE Vector & | operator*= (const T1 &scalar) |
| In-place multiplication by a scalar.
|
|
CU_HOST_DEVICE Vector & | operator/= (const T &scalar) |
| In-place division by a scalar.
|
|
template<typename T1 > |
CU_HOST_DEVICE Vector & | operator/= (const T1 &scalar) |
| In-place division by a scalar.
|
|
CU_HOST_DEVICE bool | operator== (const Vector &vec) const |
| Element-wise equality.
|
|
CU_HOST_DEVICE bool | operator!= (const Vector &vec) const |
| Element-wise inequality.
|
|
CU_HOST_DEVICE T & | operator[] (size_t idx) |
| Access to the element idx .
|
|
CU_HOST_DEVICE const T & | operator[] (size_t idx) const |
| Access to the element idx .
|
|
CU_HOST_DEVICE T | norm () const |
| Euclidean norm of the vector.
|
|
CU_HOST_DEVICE T | normsq () const |
| Square of the Euclidean norm of the vector.
|
|
CU_HOST_DEVICE Vector & | normalize (void) |
| Normalize the vector.
|
|
CU_HOST_DEVICE Vector | normalized (void) const |
| Returns a normalized version of the vector.
|
|
bool | iszero (void) |
|
Vector & | zero (void) |
|
CU_HOST_DEVICE void | set (const T &x) |
| Set the values of a 1-D vector.
|
|
CU_HOST_DEVICE void | set (const T &x, const T &y) |
| Set the values of a 2-D vector.
|
|
CU_HOST_DEVICE void | set (const T &x, const T &y, const T &z) |
| Set the values of a 3-D vector.
|
|
CU_HOST_DEVICE void | set (const T &x, const T &y, const T &z, const T &t) |
| Set the values of a 4-D vector.
|
|
CU_HOST_DEVICE Vector & | operator= (const T &value) |
| Set all the elements to value .
|
|
CU_HOST_DEVICE Vector | cross (const Vector &other) const |
| Compute the cross product as this x other .
|
|
CU_HOST_DEVICE void | x (const T &v) |
| Short access to the first element.
|
|
CU_HOST_DEVICE void | y (const T &v) |
| Short access to the second element.
|
|
CU_HOST_DEVICE void | z (const T &v) |
| Short access to the third element.
|
|
CU_HOST_DEVICE void | t (const T &v) |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE T & | x () |
| Short access to the first element.
|
|
CU_HOST_DEVICE T & | y () |
| Short access to the second element.
|
|
CU_HOST_DEVICE T & | z () |
| Short access to the third element.
|
|
CU_HOST_DEVICE T & | t () |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE const T & | x () const |
| Short access to the first element.
|
|
CU_HOST_DEVICE const T & | y () const |
| Short access to the second element.
|
|
CU_HOST_DEVICE const T & | z () const |
| Short access to the third element.
|
|
CU_HOST_DEVICE const T & | t () const |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE void | i (const T &v) |
| Short access to the first element.
|
|
CU_HOST_DEVICE void | j (const T &v) |
| Short access to the second element.
|
|
CU_HOST_DEVICE void | k (const T &v) |
| Short access to the third element.
|
|
CU_HOST_DEVICE void | l (const T &v) |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE T & | i () |
| Short access to the first element.
|
|
CU_HOST_DEVICE T & | j () |
| Short access to the second element.
|
|
CU_HOST_DEVICE T & | k () |
| Short access to the third element.
|
|
CU_HOST_DEVICE T & | l () |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE const T & | i () const |
| Short access to the first element.
|
|
CU_HOST_DEVICE const T & | j () const |
| Short access to the second element.
|
|
CU_HOST_DEVICE const T & | k () const |
| Short access to the third element.
|
|
CU_HOST_DEVICE const T & | l () const |
| Short access to the fourth element.
|
|
CU_HOST_DEVICE Vector< 2, T > | projectXY (void) |
| Extract the two first elements of the vector.
|
|
CU_HOST_DEVICE bool | operator< (const Vector &other) const |
| Comparison operator. More...
|
|
CU_HOST_DEVICE bool | operator<= (const Vector &other) const |
| Comparison operator. More...
|
|
CU_HOST_DEVICE bool | operator> (const Vector &other) const |
| Comparison operator. More...
|
|
CU_HOST_DEVICE bool | operator>= (const Vector &other) const |
| Comparison operator. More...
|
|
|
(Note that these are not member functions.)
|
template<class T > |
CU_HOST_DEVICE T | operator% (const Vector< 2, T > &v1, const Vector< 2, T > &v2) |
| Cross product v1 x v2 .
|
|
template<class T > |
CU_HOST_DEVICE T | operator^ (const Vector< 2, T > &v1, const Vector< 2, T > &v2) |
| Cross product v1 x v2 (French notation)
|
|
template<class T > |
CU_HOST_DEVICE T | operator^ (const Vector< 1, T > &, const Vector< 1, T > &) |
| Cross product v1 x v2 (French notation)
|
|
template<class T > |
CU_HOST_DEVICE Vector< 3, T > | operator% (const Vector< 3, T > &v1, const Vector< 3, T > &v2) |
| Cross product v1 x v2 .
|
|
template<class T > |
CU_HOST_DEVICE Vector< 3, T > | operator^ (const Vector< 3, T > &v1, const Vector< 3, T > &v2) |
| Cross product v1 x v2 (French notation)
|
|
template<class T > |
CU_HOST_DEVICE float | angle (const Vector< 2, T > &v) |
| Angle of the vector with (0,1)
|
|
template<class T > |
CU_HOST_DEVICE float | angle (const Vector< 3, T > &v1, const Vector< 3, T > &v2) |
| Non-oriented angle between v1 and v2 .
|
|
template<class T > |
CU_HOST_DEVICE float | angle (const Vector< 2, T > &v1, const Vector< 2, T > &v2) |
| Oriented angle between v1 and v2 .
|
|
template<class T > |
CU_HOST_DEVICE float | angle (const Vector< 1, T > &v1, const Vector< 1, T > &v2) |
| Oriented angle between v1 and v2 .
|
|
template<class T > |
CU_HOST_DEVICE float | angle (const Vector< 3, T > &v1, const Vector< 3, T > &v2, const Vector< 3, T > &ref) |
| Oriented angle between v1 and v2 with ref to orient the space.
|
|
CU_HOST_DEVICE float | normalized (float) |
| Euclidean square norm of a real. More...
|
|
CU_HOST_DEVICE float | normsq (float s) |
| Euclidean square norm of a real. More...
|
|
CU_HOST_DEVICE float | norm (float s) |
| Euclidean norm of a real. More...
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE T | norm (const Vector< dim, T > &v) |
| Function-version of the norm. More...
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE T | normsq (const Vector< dim, T > &v) |
| Function-version of the square norm. More...
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | normalized (const Vector< dim, T > &v) |
| Function-version of the square norm. More...
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | fabs (const Vector< dim, T > &v) |
| Return the vector whose component is the absolute value of the input vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | max (const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Return the vector whose component is the max of the two input vectors components.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | min (const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Return the vector whose component is the min of the two input vectors components.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | trim (const Vector< dim, T > &v, const Vector< dim, T > &minv, const Vector< dim, T > &maxv) |
| Return the vector with components clipped to min and max vectors.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | multiply (const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Return the vector whose component is the product of the two input vectors components.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | divide (const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Return the vector whose components are clipped to min/max components. More...
|
|
template<typename T > |
CU_HOST_DEVICE Vector< 3, T > | orthogonal (const Vector< 3, T > &v) |
| Find a vector orthogonal to v.
|
|
template<size_t dim, typename T , typename T1 > |
CU_HOST_DEVICE Vector< dim, T > | map (T(*fct)(T1), const Vector< dim, T1 > &v) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | map (const T &(*fct)(const T &, const T &), const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | map (T(*fct)(const T &, const T &), const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | map (T(*fct)(T, T), const Vector< dim, T > &v1, const Vector< dim, T > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T , typename T1 , typename T2 > |
CU_HOST_DEVICE Vector< dim, T > | map (const T &(*fct)(const T1 &, const T2 &), const Vector< dim, T1 > &v1, const Vector< dim, T2 > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T , typename T1 , typename T2 > |
CU_HOST_DEVICE Vector< dim, T > | map (T(*fct)(const T1 &, const T2 &), const Vector< dim, T1 > &v1, const Vector< dim, T2 > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T , typename T1 , typename T2 > |
CU_HOST_DEVICE Vector< dim, T > | map (T(*fct)(T1, T2), const Vector< dim, T1 > &v1, const Vector< dim, T2 > &v2) |
| Map a function to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | operator+ (const Vector< dim, T > &v, const T &value) |
| Add a value to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | operator+ (const T &value, const Vector< dim, T > &v) |
| Add a value to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | operator- (const Vector< dim, T > &v, const T &value) |
| Substact a value to all elements of a vector.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim, T > | operator- (const T &value, const Vector< dim, T > &v) |
| Equivalent to substracting a vector with all component the same to another one.
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim+1, T > | homogeneous (const Vector< dim, T > &v) |
| Create a homogeneous coordinate vector from a cartesian one. More...
|
|
template<size_t dim, typename T > |
CU_HOST_DEVICE Vector< dim-1, T > | cartesian (const Vector< dim, T > &v) |
| Extract the cartesion coordinates from a homogeneous vector. More...
|
|