MorphoGraphX  2.0-1-227
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Attributes | Friends | Related Functions | List of all members
mgx::Vector< dim, T > Class Template Reference

Namespace containing all the utility classes. More...

#include <vector.h>

+ Inheritance diagram for mgx::Vector< dim, T >:

Public Types

typedef T value_type
 
typedef T & reference_type
 
typedef T * pointer_type
 
typedef T * iterator
 

Public Member Functions

template<size_t d1, class T1 >
CU_HOST_DEVICE Vector (const Vector< d1, T1 > &vec)
 Copy another vector with different number of elements. More...
 
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. More...
 
CU_HOST_DEVICE Vector (const T &x, const T &y)
 Initialize a 2D vector. More...
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z)
 Initialize a 3D vector. More...
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &t)
 Initialize a 4D vector. More...
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &a, const T &b)
 Initialize a 5D vector. More...
 
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. More...
 
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. More...
 
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)
 Initialize a 8D vector. More...
 
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)
 Initialize a 9D vector. More...
 
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. More...
 
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, const T &m, const T &n, const T &o, const T &p, const T &q, const T &r)
 Initialize a 18D vector. More...
 
CU_HOST_DEVICE T * data ()
 Returns a raw pointer on the data. More...
 
CU_HOST_DEVICE iterator begin ()
 STL-iteration begin. More...
 
CU_HOST_DEVICE const_iterator begin () const
 Stl-iteration constant begin. More...
 
CU_HOST_DEVICE iterator end ()
 STL-iteration end. More...
 
CU_HOST_DEVICE const_iterator end () const
 Stl-iteration constant end. More...
 
const CU_HOST_DEVICE T * c_data () const
 Returns a constant raw pointer on the data. More...
 
CU_HOST_DEVICE Vector operator- (void) const
 Vector negation. More...
 
CU_HOST_DEVICE Vector operator+ (const Vector &vec) const
 Vector addition. More...
 
CU_HOST_DEVICE Vector operator- (const Vector &vec) const
 Vector subtraction. More...
 
CU_HOST_DEVICE Vector mult (const Vector &vec) const
 Element-wise multiplcation. More...
 
CU_HOST_DEVICE Vector operator* (const T &scalar) const
 Multiplication by a scalar. More...
 
CU_HOST_DEVICE Vector operator/ (const T &scalar) const
 Division by a scalar. More...
 
CU_HOST_DEVICE Vector operator/ (const Vector &vec) const
 Element-wise division. More...
 
CU_HOST_DEVICE Vectoroperator/= (const Vector &vec)
 In-place element-wise division by a scalar. More...
 
CU_HOST_DEVICEoperator* (const Vector &vec) const
 Dot product. More...
 
CU_HOST_DEVICE Vectoroperator+= (const Vector &vec)
 Vector copy. More...
 
CU_HOST_DEVICE Vectoroperator+= (const T &val)
 In-place constant addition. More...
 
CU_HOST_DEVICE Vectoroperator-= (const Vector &vec)
 In-place vector subtraction. More...
 
CU_HOST_DEVICE Vectoroperator-= (const T &val)
 In-place value subtraction. More...
 
CU_HOST_DEVICE Vectoroperator*= (const T &scalar)
 In-place multiplication by a scalar. More...
 
template<typename T1 >
CU_HOST_DEVICE Vectoroperator*= (const T1 &scalar)
 In-place multiplication by a scalar. More...
 
CU_HOST_DEVICE Vectoroperator/= (const T &scalar)
 In-place division by a scalar. More...
 
template<typename T1 >
CU_HOST_DEVICE Vectoroperator/= (const T1 &scalar)
 In-place division by a scalar. More...
 
CU_HOST_DEVICE bool operator== (const Vector &vec) const
 Element-wise equality. More...
 
CU_HOST_DEVICE bool operator!= (const Vector &vec) const
 Element-wise inequality. More...
 
CU_HOST_DEVICE T & operator[] (size_t idx)
 Access to the element idx. More...
 
const CU_HOST_DEVICE T & operator[] (size_t idx) const
 Access to the element idx. More...
 
CU_HOST_DEVICEnorm () const
 Euclidean norm of the vector. More...
 
CU_HOST_DEVICEnormsq () const
 Square of the Euclidean norm of the vector. More...
 
CU_HOST_DEVICE Vectornormalize (void)
 Normalize the vector. More...
 
CU_HOST_DEVICE Vector normalized (void) const
 Returns a normalized version of the vector. More...
 
bool iszero (void)
 
Vectorzero (void)
 
CU_HOST_DEVICE void set (const T &x)
 Set the values of a 1-D vector. More...
 
CU_HOST_DEVICE void set (const T &x, const T &y)
 Set the values of a 2-D vector. More...
 
CU_HOST_DEVICE void set (const T &x, const T &y, const T &z)
 Set the values of a 3-D vector. More...
 
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. More...
 
CU_HOST_DEVICE Vectoroperator= (const T &value)
 Set all the elements to value. More...
 
CU_HOST_DEVICE Vector cross (const Vector &other) const
 Compute the cross product as this x other. More...
 
CU_HOST_DEVICE void x (const T &v)
 Short access to the first element. More...
 
CU_HOST_DEVICE void y (const T &v)
 Short access to the second element. More...
 
CU_HOST_DEVICE void z (const T &v)
 Short access to the third element. More...
 
CU_HOST_DEVICE void t (const T &v)
 Short access to the fourth element. More...
 
CU_HOST_DEVICE T & x ()
 Short access to the first element. More...
 
CU_HOST_DEVICE T & y ()
 Short access to the second element. More...
 
CU_HOST_DEVICE T & z ()
 Short access to the third element. More...
 
CU_HOST_DEVICE T & t ()
 Short access to the fourth element. More...
 
const CU_HOST_DEVICE T & x () const
 Short access to the first element. More...
 
const CU_HOST_DEVICE T & y () const
 Short access to the second element. More...
 
const CU_HOST_DEVICE T & z () const
 Short access to the third element. More...
 
const CU_HOST_DEVICE T & t () const
 Short access to the fourth element. More...
 
CU_HOST_DEVICE void i (const T &v)
 Short access to the first element. More...
 
CU_HOST_DEVICE void j (const T &v)
 Short access to the second element. More...
 
CU_HOST_DEVICE void k (const T &v)
 Short access to the third element. More...
 
CU_HOST_DEVICE void l (const T &v)
 Short access to the fourth element. More...
 
CU_HOST_DEVICE T & i ()
 Short access to the first element. More...
 
CU_HOST_DEVICE T & j ()
 Short access to the second element. More...
 
CU_HOST_DEVICE T & k ()
 Short access to the third element. More...
 
CU_HOST_DEVICE T & l ()
 Short access to the fourth element. More...
 
const CU_HOST_DEVICE T & i () const
 Short access to the first element. More...
 
const CU_HOST_DEVICE T & j () const
 Short access to the second element. More...
 
const CU_HOST_DEVICE T & k () const
 Short access to the third element. More...
 
const CU_HOST_DEVICE T & l () const
 Short access to the fourth element. More...
 
CU_HOST_DEVICE Vector< 2, T > projectXY (void)
 Extract the two first elements of the vector. 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...
 
CU_HOST_DEVICE bool operator>= (const Vector &other) const
 Comparison operator. More...
 

Static Public Member Functions

static CU_HOST_DEVICE size_t size ()
 Returns the size of the vector (i.e. More...
 

Public Attributes

const typedef T & const_reference_type
 
const typedef T * const_pointer_type
 
const typedef T * const_iterator
 

Static Public Attributes

static const size_t numElems
 

Protected Attributes

elems [dim]
 

Friends

CU_HOST_DEVICE friend Vector operator* (const T &scalar, const Vector &vec)
 Multiplication by a scalar. More...
 
std::ostream & operator<< (std::ostream &out, const Vector &vec)
 
std::istream & operator>> (std::istream &in, Vector &vec)
 
QTextStream & operator<< (QTextStream &out, const Vector &vec)
 
QTextStream & operator>> (QTextStream &in, Vector &vec)
 

Related Functions

(Note that these are not member functions.)

template<class T >
CU_HOST_DEVICEoperator% (const Vector< 2, T > &v1, const Vector< 2, T > &v2)
 Cross product v1 x v2. More...
 
template<class T >
CU_HOST_DEVICEoperator^ (const Vector< 2, T > &v1, const Vector< 2, T > &v2)
 Cross product v1 x v2 (French notation) More...
 
template<class T >
CU_HOST_DEVICEoperator^ (const Vector< 1, T > &, const Vector< 1, T > &)
 Cross product v1 x v2 (French notation) More...
 
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. More...
 
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) More...
 
template<class T >
CU_HOST_DEVICE float angle (const Vector< 2, T > &v)
 Angle of the vector with (0,1) More...
 
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. More...
 
template<class T >
CU_HOST_DEVICE float angle (const Vector< 2, T > &v1, const Vector< 2, T > &v2)
 Oriented angle between v1 and v2. More...
 
template<class T >
CU_HOST_DEVICE float angle (const Vector< 1, T > &v1, const Vector< 1, T > &v2)
 Oriented angle between v1 and v2. More...
 
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. More...
 
CU_HOST_DEVICE float normalized (float)
 Normalized 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_DEVICEnorm (const Vector< dim, T > &v)
 Function-version of the norm. More...
 
template<size_t dim, typename T >
CU_HOST_DEVICEnormsq (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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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 component is the ratio of the two input vectors components. More...
 
template<typename T >
CU_HOST_DEVICE Vector< 3, T > orthogonal (const Vector< 3, T > &v)
 Find a vector orthogonal to v. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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...
 

Detailed Description

template<size_t dim, class T = float>
class mgx::Vector< dim, T >

Namespace containing all the utility classes.

Vector class supporting all classic classic vector operations.

Note
The addition and subtraction with a scalar is possible and is equivalent to adding/subtracting a vector filled with the scalar.

Definition at line 48 of file Vector.hpp.

Member Typedef Documentation

◆ iterator

template<size_t dim, class T = float>
typedef T* mgx::Vector< dim, T >::iterator

Definition at line 58 of file Vector.hpp.

◆ pointer_type

template<size_t dim, class T = float>
typedef T* mgx::Vector< dim, T >::pointer_type

Definition at line 56 of file Vector.hpp.

◆ reference_type

template<size_t dim, class T = float>
typedef T& mgx::Vector< dim, T >::reference_type

Definition at line 54 of file Vector.hpp.

◆ value_type

template<size_t dim, class T = float>
typedef T mgx::Vector< dim, T >::value_type

Definition at line 53 of file Vector.hpp.

Constructor & Destructor Documentation

◆ Vector() [1/13]

template<size_t dim, class T = float>
template<size_t d1, class T1 >
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const Vector< d1, T1 > &  vec)
inlineexplicit

Copy another vector with different number of elements.

Definition at line 85 of file Vector.hpp.

◆ Vector() [2/13]

template<size_t dim, class T = float>
template<class Vec >
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const Vec el)
inlineexplicit

Initialize a vector from any object behaving like an array.

The only constraints are:

  • the type has to be convertible to T
  • the vector needs a [] operator
  • the size of the vector has to be at least dim

Definition at line 108 of file Vector.hpp.

◆ Vector() [3/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x = T())
inlineexplicit

Initialize a vector with all values to x.

Definition at line 119 of file Vector.hpp.

◆ Vector() [4/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y 
)
inlineexplicit

Initialize a 2D vector.

Definition at line 129 of file Vector.hpp.

◆ Vector() [5/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y,
const T &  z 
)
inlineexplicit

Initialize a 3D vector.

Definition at line 140 of file Vector.hpp.

◆ Vector() [6/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y,
const T &  z,
const T &  t 
)
inlineexplicit

Initialize a 4D vector.

Definition at line 152 of file Vector.hpp.

◆ Vector() [7/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y,
const T &  z,
const T &  a,
const T &  b 
)
inline

Initialize a 5D vector.

Definition at line 165 of file Vector.hpp.

◆ Vector() [8/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y,
const T &  z,
const T &  a,
const T &  b,
const T &  c 
)
inline

Initialize a 6D vector.

Definition at line 179 of file Vector.hpp.

◆ Vector() [9/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::Vector ( const T &  x,
const T &  y,
const T &  z,
const T &  a,
const T &  b,
const T &  c,
const T &  d 
)
inline

Initialize a 7D vector.

Definition at line 194 of file Vector.hpp.

◆ Vector() [10/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::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 
)
inline

Initialize a 8D vector.

Definition at line 210 of file Vector.hpp.

◆ Vector() [11/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::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 
)
inline

Initialize a 9D vector.

Definition at line 227 of file Vector.hpp.

◆ Vector() [12/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::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 
)
inline

Initialize a 12D vector.

Definition at line 246 of file Vector.hpp.

◆ Vector() [13/13]

template<size_t dim, class T = float>
CU_HOST_DEVICE mgx::Vector< dim, T >::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,
const T &  m,
const T &  n,
const T &  o,
const T &  p,
const T &  q,
const T &  r 
)
inline

Initialize a 18D vector.

Definition at line 268 of file Vector.hpp.

Member Function Documentation

◆ begin() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE iterator mgx::Vector< dim, T >::begin ( )
inline

STL-iteration begin.

Definition at line 309 of file Vector.hpp.

◆ begin() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE const_iterator mgx::Vector< dim, T >::begin ( ) const
inline

Stl-iteration constant begin.

Definition at line 314 of file Vector.hpp.

◆ c_data()

template<size_t dim, class T = float>
const CU_HOST_DEVICE T* mgx::Vector< dim, T >::c_data ( ) const
inline

Returns a constant raw pointer on the data.

Definition at line 331 of file Vector.hpp.

◆ cross()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::cross ( const Vector< dim, T > &  other) const
inline

Compute the cross product as this x other.

Definition at line 711 of file Vector.hpp.

◆ data()

template<size_t dim, class T = float>
CU_HOST_DEVICE T* mgx::Vector< dim, T >::data ( )
inline

Returns a raw pointer on the data.

Definition at line 303 of file Vector.hpp.

◆ end() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE iterator mgx::Vector< dim, T >::end ( )
inline

STL-iteration end.

Definition at line 320 of file Vector.hpp.

◆ end() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE const_iterator mgx::Vector< dim, T >::end ( ) const
inline

Stl-iteration constant end.

Definition at line 325 of file Vector.hpp.

◆ i() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::i ( )
inline

Short access to the first element.

Definition at line 866 of file Vector.hpp.

◆ i() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::i ( ) const
inline

Short access to the first element.

Definition at line 902 of file Vector.hpp.

◆ i() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::i ( const T &  v)
inline

Short access to the first element.

Definition at line 830 of file Vector.hpp.

◆ iszero()

template<size_t dim, class T = float>
bool mgx::Vector< dim, T >::iszero ( void  )
inline

Definition at line 634 of file Vector.hpp.

◆ j() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::j ( )
inline

Short access to the second element.

Definition at line 875 of file Vector.hpp.

◆ j() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::j ( ) const
inline

Short access to the second element.

Definition at line 911 of file Vector.hpp.

◆ j() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::j ( const T &  v)
inline

Short access to the second element.

Definition at line 839 of file Vector.hpp.

◆ k() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::k ( )
inline

Short access to the third element.

Definition at line 884 of file Vector.hpp.

◆ k() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::k ( ) const
inline

Short access to the third element.

Definition at line 920 of file Vector.hpp.

◆ k() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::k ( const T &  v)
inline

Short access to the third element.

Definition at line 848 of file Vector.hpp.

◆ l() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::l ( )
inline

Short access to the fourth element.

Definition at line 893 of file Vector.hpp.

◆ l() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::l ( ) const
inline

Short access to the fourth element.

Definition at line 929 of file Vector.hpp.

◆ l() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::l ( const T &  v)
inline

Short access to the fourth element.

Definition at line 857 of file Vector.hpp.

◆ mult()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::mult ( const Vector< dim, T > &  vec) const
inline

Element-wise multiplcation.

Definition at line 372 of file Vector.hpp.

◆ norm()

template<size_t dim, class T = float>
CU_HOST_DEVICE T mgx::Vector< dim, T >::norm ( ) const
inline

Euclidean norm of the vector.

Definition at line 591 of file Vector.hpp.

◆ normalize()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::normalize ( void  )
inline

Normalize the vector.

Definition at line 618 of file Vector.hpp.

◆ normalized()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::normalized ( void  ) const
inline

Returns a normalized version of the vector.

Definition at line 628 of file Vector.hpp.

◆ normsq()

template<size_t dim, class T = float>
CU_HOST_DEVICE T mgx::Vector< dim, T >::normsq ( ) const
inline

Square of the Euclidean norm of the vector.

Definition at line 605 of file Vector.hpp.

◆ operator!=()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator!= ( const Vector< dim, T > &  vec) const
inline

Element-wise inequality.

Definition at line 567 of file Vector.hpp.

◆ operator*() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator* ( const T &  scalar) const
inline

Multiplication by a scalar.

Definition at line 384 of file Vector.hpp.

◆ operator*() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE T mgx::Vector< dim, T >::operator* ( const Vector< dim, T > &  vec) const
inline

Dot product.

Definition at line 441 of file Vector.hpp.

◆ operator*=() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator*= ( const T &  scalar)
inline

In-place multiplication by a scalar.

Definition at line 510 of file Vector.hpp.

◆ operator*=() [2/2]

template<size_t dim, class T = float>
template<typename T1 >
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator*= ( const T1 &  scalar)
inline

In-place multiplication by a scalar.

Definition at line 521 of file Vector.hpp.

◆ operator+()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator+ ( const Vector< dim, T > &  vec) const
inline

Vector addition.

Definition at line 350 of file Vector.hpp.

◆ operator+=() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator+= ( const T &  val)
inline

In-place constant addition.

Definition at line 477 of file Vector.hpp.

◆ operator+=() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator+= ( const Vector< dim, T > &  vec)
inline

Vector copy.

In-place vector addition

Definition at line 466 of file Vector.hpp.

◆ operator-() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator- ( const Vector< dim, T > &  vec) const
inline

Vector subtraction.

Definition at line 361 of file Vector.hpp.

◆ operator-() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator- ( void  ) const
inline

Vector negation.

Definition at line 337 of file Vector.hpp.

◆ operator-=() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator-= ( const T &  val)
inline

In-place value subtraction.

Definition at line 499 of file Vector.hpp.

◆ operator-=() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator-= ( const Vector< dim, T > &  vec)
inline

In-place vector subtraction.

Definition at line 488 of file Vector.hpp.

◆ operator/() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator/ ( const T &  scalar) const
inline

Division by a scalar.

Definition at line 395 of file Vector.hpp.

◆ operator/() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector mgx::Vector< dim, T >::operator/ ( const Vector< dim, T > &  vec) const
inline

Element-wise division.

Definition at line 406 of file Vector.hpp.

◆ operator/=() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator/= ( const T &  scalar)
inline

In-place division by a scalar.

Definition at line 532 of file Vector.hpp.

◆ operator/=() [2/3]

template<size_t dim, class T = float>
template<typename T1 >
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator/= ( const T1 &  scalar)
inline

In-place division by a scalar.

Definition at line 543 of file Vector.hpp.

◆ operator/=() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator/= ( const Vector< dim, T > &  vec)
inline

In-place element-wise division by a scalar.

Definition at line 417 of file Vector.hpp.

◆ operator<()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator< ( const Vector< dim, T > &  other) const
inline

Comparison operator.

Compare the axis in order.

Definition at line 951 of file Vector.hpp.

◆ operator<=()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator<= ( const Vector< dim, T > &  other) const
inline

Comparison operator.

Compare the axis in order.

Definition at line 968 of file Vector.hpp.

◆ operator=()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector& mgx::Vector< dim, T >::operator= ( const T &  value)
inline

Set all the elements to value.

Definition at line 699 of file Vector.hpp.

◆ operator==()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator== ( const Vector< dim, T > &  vec) const
inline

Element-wise equality.

Definition at line 554 of file Vector.hpp.

◆ operator>()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator> ( const Vector< dim, T > &  other) const
inline

Comparison operator.

Compare the axis in order.

Definition at line 985 of file Vector.hpp.

◆ operator>=()

template<size_t dim, class T = float>
CU_HOST_DEVICE bool mgx::Vector< dim, T >::operator>= ( const Vector< dim, T > &  other) const
inline

Comparison operator.

Compare the axis in order.

Definition at line 1002 of file Vector.hpp.

◆ operator[]() [1/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::operator[] ( size_t  idx)
inline

Access to the element idx.

Definition at line 575 of file Vector.hpp.

◆ operator[]() [2/2]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::operator[] ( size_t  idx) const
inline

Access to the element idx.

Definition at line 583 of file Vector.hpp.

◆ projectXY()

template<size_t dim, class T = float>
CU_HOST_DEVICE Vector<2, T> mgx::Vector< dim, T >::projectXY ( void  )
inline

Extract the two first elements of the vector.

Definition at line 939 of file Vector.hpp.

◆ set() [1/4]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::set ( const T &  x)
inline

Set the values of a 1-D vector.

Definition at line 653 of file Vector.hpp.

◆ set() [2/4]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::set ( const T &  x,
const T &  y 
)
inline

Set the values of a 2-D vector.

Definition at line 663 of file Vector.hpp.

◆ set() [3/4]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::set ( const T &  x,
const T &  y,
const T &  z 
)
inline

Set the values of a 3-D vector.

Definition at line 674 of file Vector.hpp.

◆ set() [4/4]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::set ( const T &  x,
const T &  y,
const T &  z,
const T &  t 
)
inline

Set the values of a 4-D vector.

Definition at line 686 of file Vector.hpp.

◆ size()

template<size_t dim, class T = float>
static CU_HOST_DEVICE size_t mgx::Vector< dim, T >::size ( )
inlinestatic

Returns the size of the vector (i.e.

the number of elements)

Definition at line 297 of file Vector.hpp.

◆ t() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::t ( )
inline

Short access to the fourth element.

Definition at line 784 of file Vector.hpp.

◆ t() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::t ( ) const
inline

Short access to the fourth element.

Definition at line 820 of file Vector.hpp.

◆ t() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::t ( const T &  v)
inline

Short access to the fourth element.

Definition at line 748 of file Vector.hpp.

◆ x() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::x ( )
inline

Short access to the first element.

Definition at line 757 of file Vector.hpp.

◆ x() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::x ( ) const
inline

Short access to the first element.

Definition at line 793 of file Vector.hpp.

◆ x() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::x ( const T &  v)
inline

Short access to the first element.

Definition at line 721 of file Vector.hpp.

◆ y() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::y ( )
inline

Short access to the second element.

Definition at line 766 of file Vector.hpp.

◆ y() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::y ( ) const
inline

Short access to the second element.

Definition at line 802 of file Vector.hpp.

◆ y() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::y ( const T &  v)
inline

Short access to the second element.

Definition at line 730 of file Vector.hpp.

◆ z() [1/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE T& mgx::Vector< dim, T >::z ( )
inline

Short access to the third element.

Definition at line 775 of file Vector.hpp.

◆ z() [2/3]

template<size_t dim, class T = float>
const CU_HOST_DEVICE T& mgx::Vector< dim, T >::z ( ) const
inline

Short access to the third element.

Definition at line 811 of file Vector.hpp.

◆ z() [3/3]

template<size_t dim, class T = float>
CU_HOST_DEVICE void mgx::Vector< dim, T >::z ( const T &  v)
inline

Short access to the third element.

Definition at line 739 of file Vector.hpp.

◆ zero()

template<size_t dim, class T = float>
Vector& mgx::Vector< dim, T >::zero ( void  )
inline

Definition at line 642 of file Vector.hpp.

Friends And Related Function Documentation

◆ angle() [1/5]

template<class T >
CU_HOST_DEVICE float angle ( const Vector< 1, T > &  v1,
const Vector< 1, T > &  v2 
)
related

Oriented angle between v1 and v2.

Definition at line 1153 of file Vector.hpp.

◆ angle() [2/5]

template<class T >
CU_HOST_DEVICE float angle ( const Vector< 2, T > &  v)
related

Angle of the vector with (0,1)

Definition at line 1116 of file Vector.hpp.

◆ angle() [3/5]

template<class T >
CU_HOST_DEVICE float angle ( const Vector< 2, T > &  v1,
const Vector< 2, T > &  v2 
)
related

Oriented angle between v1 and v2.

Definition at line 1140 of file Vector.hpp.

◆ angle() [4/5]

template<class T >
CU_HOST_DEVICE float angle ( const Vector< 3, T > &  v1,
const Vector< 3, T > &  v2 
)
related

Non-oriented angle between v1 and v2.

Definition at line 1127 of file Vector.hpp.

◆ angle() [5/5]

template<class T >
CU_HOST_DEVICE float angle ( const Vector< 3, T > &  v1,
const Vector< 3, T > &  v2,
const Vector< 3, T > &  ref 
)
related

Oriented angle between v1 and v2 with ref to orient the space.

Definition at line 1164 of file Vector.hpp.

◆ cartesian()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim - 1, T > cartesian ( const Vector< dim, T > &  v)
related

Extract the cartesion coordinates from a homogeneous vector.

Warning
The homogenous coordinate shouldn't be zero or there will be a division by 0!

Definition at line 1592 of file Vector.hpp.

◆ divide()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > divide ( const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Return the vector whose component is the ratio of the two input vectors components.

Definition at line 1348 of file Vector.hpp.

◆ fabs()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > fabs ( const Vector< dim, T > &  v)
related

Return the vector whose component is the absolute value of the input vector.

Definition at line 1256 of file Vector.hpp.

◆ homogeneous()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim+1, T > homogeneous ( const Vector< dim, T > &  v)
related

Create a homogeneous coordinate vector from a cartesian one.

This adds one dimension, and set it to 1.

Definition at line 1577 of file Vector.hpp.

◆ map() [1/7]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > map ( const T &(*)(const T &, const T &)  fct,
const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1425 of file Vector.hpp.

◆ map() [2/7]

template<size_t dim, typename T , typename T1 , typename T2 >
CU_HOST_DEVICE Vector< dim, T > map ( const T &(*)(const T1 &, const T2 &)  fct,
const Vector< dim, T1 > &  v1,
const Vector< dim, T2 > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1471 of file Vector.hpp.

◆ map() [3/7]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > map ( T(*)(const T &, const T &)  fct,
const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1441 of file Vector.hpp.

◆ map() [4/7]

template<size_t dim, typename T , typename T1 , typename T2 >
CU_HOST_DEVICE Vector< dim, T > map ( T(*)(const T1 &, const T2 &)  fct,
const Vector< dim, T1 > &  v1,
const Vector< dim, T2 > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1487 of file Vector.hpp.

◆ map() [5/7]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > map ( T(*)(T, T)  fct,
const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1456 of file Vector.hpp.

◆ map() [6/7]

template<size_t dim, typename T , typename T1 >
CU_HOST_DEVICE Vector< dim, T > map ( T(*)(T1)  fct,
const Vector< dim, T1 > &  v 
)
related

Map a function to all elements of a vector.

Definition at line 1410 of file Vector.hpp.

◆ map() [7/7]

template<size_t dim, typename T , typename T1 , typename T2 >
CU_HOST_DEVICE Vector< dim, T > map ( T(*)(T1, T2)  fct,
const Vector< dim, T1 > &  v1,
const Vector< dim, T2 > &  v2 
)
related

Map a function to all elements of a vector.

Definition at line 1503 of file Vector.hpp.

◆ max()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > max ( const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Return the vector whose component is the max of the two input vectors components.

Definition at line 1272 of file Vector.hpp.

◆ min()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > min ( const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Return the vector whose component is the min of the two input vectors components.

Definition at line 1288 of file Vector.hpp.

◆ multiply()

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > multiply ( const Vector< dim, T > &  v1,
const Vector< dim, T > &  v2 
)
related

Return the vector whose component is the product of the two input vectors components.

Definition at line 1317 of file Vector.hpp.

◆ norm() [1/2]

template<size_t dim, typename T >
CU_HOST_DEVICE T norm ( const Vector< dim, T > &  v)
related

Function-version of the norm.

See also
Vector::norm()

Definition at line 1221 of file Vector.hpp.

◆ norm() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE float norm ( float  s)
related

Euclidean norm of a real.

Just the absolute value of that real

Definition at line 1209 of file Vector.hpp.

◆ normalized() [1/2]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > normalized ( const Vector< dim, T > &  v)
related

Function-version of the square norm.

See also
Vector::normsq()

Definition at line 1243 of file Vector.hpp.

◆ normalized() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE float normalized ( float  )
related

Normalized real.

Just return 1

Definition at line 1183 of file Vector.hpp.

◆ normsq() [1/2]

template<size_t dim, typename T >
CU_HOST_DEVICE T normsq ( const Vector< dim, T > &  v)
related

Function-version of the square norm.

See also
Vector::normsq()

Definition at line 1232 of file Vector.hpp.

◆ normsq() [2/2]

template<size_t dim, class T = float>
CU_HOST_DEVICE float normsq ( float  s)
related

Euclidean square norm of a real.

Just the square of the real

Definition at line 1196 of file Vector.hpp.

◆ operator%() [1/2]

template<class T >
CU_HOST_DEVICE T operator% ( const Vector< 2, T > &  v1,
const Vector< 2, T > &  v2 
)
related

Cross product v1 x v2.

Definition at line 1058 of file Vector.hpp.

◆ operator%() [2/2]

template<class T >
CU_HOST_DEVICE Vector< 3, T > operator% ( const Vector< 3, T > &  v1,
const Vector< 3, T > &  v2 
)
related

Cross product v1 x v2.

Definition at line 1091 of file Vector.hpp.

◆ operator*

template<size_t dim, class T = float>
CU_HOST_DEVICE friend Vector operator* ( const T &  scalar,
const Vector< dim, T > &  vec 
)
friend

Multiplication by a scalar.

Definition at line 428 of file Vector.hpp.

◆ operator+() [1/2]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > operator+ ( const T &  value,
const Vector< dim, T > &  v 
)
related

Add a value to all elements of a vector.

Definition at line 1532 of file Vector.hpp.

◆ operator+() [2/2]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > operator+ ( const Vector< dim, T > &  v,
const T &  value 
)
related

Add a value to all elements of a vector.

Definition at line 1518 of file Vector.hpp.

◆ operator-() [1/2]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > operator- ( const T &  value,
const Vector< dim, T > &  v 
)
related

Equivalent to substracting a vector with all component the same to another one.

Definition at line 1561 of file Vector.hpp.

◆ operator-() [2/2]

template<size_t dim, typename T >
CU_HOST_DEVICE Vector< dim, T > operator- ( const Vector< dim, T > &  v,
const T &  value 
)
related

Substact a value to all elements of a vector.

Definition at line 1546 of file Vector.hpp.

◆ operator<< [1/2]

template<size_t dim, class T = float>
QTextStream& operator<< ( QTextStream &  out,
const Vector< dim, T > &  vec 
)
friend

Definition at line 1032 of file Vector.hpp.

◆ operator<< [2/2]

template<size_t dim, class T = float>
std::ostream& operator<< ( std::ostream &  out,
const Vector< dim, T > &  vec 
)
friend

Definition at line 1013 of file Vector.hpp.

◆ operator>> [1/2]

template<size_t dim, class T = float>
QTextStream& operator>> ( QTextStream &  in,
Vector< dim, T > &  vec 
)
friend

Definition at line 1042 of file Vector.hpp.

◆ operator>> [2/2]

template<size_t dim, class T = float>
std::istream& operator>> ( std::istream &  in,
Vector< dim, T > &  vec 
)
friend

Definition at line 1023 of file Vector.hpp.

◆ operator^() [1/3]

template<class T >
CU_HOST_DEVICE T operator^ ( const Vector< 1, T > &  ,
const Vector< 1, T > &   
)
related

Cross product v1 x v2 (French notation)

Definition at line 1080 of file Vector.hpp.

◆ operator^() [2/3]

template<class T >
CU_HOST_DEVICE T operator^ ( const Vector< 2, T > &  v1,
const Vector< 2, T > &  v2 
)
related

Cross product v1 x v2 (French notation)

Definition at line 1069 of file Vector.hpp.

◆ operator^() [3/3]

template<class T >
CU_HOST_DEVICE Vector< 3, T > operator^ ( const Vector< 3, T > &  v1,
const Vector< 3, T > &  v2 
)
related

Cross product v1 x v2 (French notation)

Definition at line 1102 of file Vector.hpp.

◆ orthogonal()

template<typename T >
CU_HOST_DEVICE Vector< 3, T > orthogonal ( const Vector< 3, T > &  v)
related

Find a vector orthogonal to v.

Definition at line 1363 of file Vector.hpp.

◆ trim()

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 
)
related

Return the vector with components clipped to min and max vectors.

Definition at line 1303 of file Vector.hpp.

Member Data Documentation

◆ const_iterator

template<size_t dim, class T = float>
const typedef T* mgx::Vector< dim, T >::const_iterator

Definition at line 59 of file Vector.hpp.

◆ const_pointer_type

template<size_t dim, class T = float>
const typedef T* mgx::Vector< dim, T >::const_pointer_type

Definition at line 57 of file Vector.hpp.

◆ const_reference_type

template<size_t dim, class T = float>
const typedef T& mgx::Vector< dim, T >::const_reference_type

Definition at line 55 of file Vector.hpp.

◆ elems

template<size_t dim, class T = float>
T mgx::Vector< dim, T >::elems[dim]
protected

Definition at line 50 of file Vector.hpp.

◆ numElems

template<size_t dim, class T = float>
const size_t mgx::Vector< dim, T >::numElems
static

Definition at line 61 of file Vector.hpp.


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