Loading...
Searching...
No Matches
jrlMathTools::Vector4D< T > Struct Template Reference

Generic 4D vector. More...

#include <jrl/mathtools/vector4.hh>

Public Member Functions

 Vector4D ()
 Default constructor: all fields are set to zero.
 
 Vector4D (const T &x, const T &y, const T &z, const T &w=1.)
 
Vector4D< T > operator= (const Vector4D< T > &v)
 Assignement operator.
 
Vector4D< T > operator= (const Vector3D< T > &v)
 Assignement operator from vector3d.
 
Vector4D< T > operator- ()
 Unary operator -.
 
T & operator[] (unsigned i)
 Array operator.
 
const T & operator[] (unsigned i) const
 Array operator.
 
T & operator() (unsigned i)
 Array operator.
 
operator() (unsigned i) const
 Array operator.
 
bool operator== (const Vector4D< T > &v) const
 Binary operator ==.
 
Vector4D< T > operator+ (const Vector4D< T > &v) const
 Binary operator +.
 
Vector4D< T > operator- (const Vector4D< T > &v) const
 Binary operator -.
 
void operator+= (const Vector4D< T > &v)
 Binary operator +=.
 
void operator-= (const Vector4D< T > &v)
 Binary operator -=.
 
Vector4D< T > operator* (const T &t) const
 Binary operator *.
 
Vector4D< T > operator/ (const T &t) const
 Binary operator /.
 
void operator*= (const T &t)
 Binary operator *=.
 
void operator/= (const T &t)
 Binary operator /=.
 
void normalize ()
 Normalize.
 
norm () const
 Get the norm.
 
normsquared () const
 Get the norm squared.
 
std::ostream & display (std::ostream &os) const
 

Public Attributes

m_x
 
m_y
 
m_z
 
m_w
 

Detailed Description

template<typename T>
struct jrlMathTools::Vector4D< T >

Generic 4D vector.

Constructor & Destructor Documentation

◆ Vector4D() [1/2]

template<typename T >
jrlMathTools::Vector4D< T >::Vector4D ( )
inline

Default constructor: all fields are set to zero.

◆ Vector4D() [2/2]

template<typename T >
jrlMathTools::Vector4D< T >::Vector4D ( const T & x,
const T & y,
const T & z,
const T & w = 1. )
inlineexplicit

Member Function Documentation

◆ display()

◆ norm()

◆ normalize()

◆ normsquared()

◆ operator()() [1/2]

template<typename T >
T & jrlMathTools::Vector4D< T >::operator() ( unsigned i)
inline

Array operator.

◆ operator()() [2/2]

template<typename T >
T jrlMathTools::Vector4D< T >::operator() ( unsigned i) const
inline

Array operator.

◆ operator*()

◆ operator*=()

◆ operator+()

◆ operator+=()

◆ operator-() [1/2]

◆ operator-() [2/2]

◆ operator-=()

◆ operator/()

◆ operator/=()

◆ operator=() [1/2]

template<typename T >
Vector4D< T > jrlMathTools::Vector4D< T >::operator= ( const Vector3D< T > & v)
inline

◆ operator=() [2/2]

◆ operator==()

◆ operator[]() [1/2]

◆ operator[]() [2/2]

Member Data Documentation

◆ m_w

◆ m_x

◆ m_y

◆ m_z