A simple 3D vector type. More...
#include <mia/3d/vector.hh>
Public Types | |
typedef T | value_type |
typedef for generic programming More... | |
Public Member Functions | |
void | fill (T v) |
Fill the vector elements with value v. More... | |
double | norm () const |
double | norm2 () const |
square of Euclidian norm of the vector More... | |
T3DVector< T > & | operator*= (const double a) |
inplace multiplication More... | |
T3DVector< T > & | operator*= (const T3DVector< T > &a) |
inplace component wise multiplication More... | |
T3DVector< T > & | operator+= (const T3DVector< T > &a) |
inplace addition More... | |
T3DVector< T > & | operator-= (const T3DVector< T > &a) |
inplace subtraction More... | |
T3DVector< T > & | operator/= (const double a) |
inplace divisison by a scalar More... | |
T3DVector< T > & | operator= (const T3DVector< T > &other)=default |
we provide the default copy mechanisms More... | |
template<class in > | |
T3DVector< T > & | operator= (const T3DVector< in > &org) |
assignment from different vector type More... | |
const T | operator[] (size_t i) const |
T & | operator[] (size_t i) |
double | product () const |
void | read (std::istream &is) |
read the vector from a formatted string More... | |
int | size () const |
T3DVector () | |
standart constructor More... | |
T3DVector (int dim) | |
create a zero-vector, dim must be 3 More... | |
T3DVector (const T3DVector< T > &other)=default | |
we provide the default copy mechanisms More... | |
T3DVector (const T &x_, const T &y_, const T &z_) | |
constructor to construct vector from values More... | |
template<class in > | |
T3DVector (const T3DVector< in > &org) | |
type casting copy constructor More... | |
void | write (std::ostream &os) const |
print out the formatted vector to the stream More... | |
const T3DVector< T > & | xyz () const |
swizzle operator More... | |
const T3DVector< T > | xzy () const |
swizzle operator More... | |
const T3DVector< T > | yxz () const |
swizzle operator More... | |
const T3DVector< T > | yzx () const |
swizzle operator More... | |
const T3DVector< T > | zxy () const |
swizzle operator More... | |
const T3DVector< T > | zyx () const |
swizzle operator More... | |
Data Fields | |
T | x |
vector element More... | |
T | y |
vector element More... | |
T | z |
vector element More... | |
Static Public Attributes | |
static T3DVector< T > | _0 = T3DVector<T>(0,0,0) |
declare the vector (0,0,0) More... | |
static T3DVector< T > | _1 = T3DVector<T>(1,1,1) |
declare the vector (1,1,1) More... | |
static const unsigned int | elements |
the number of elements this vector holds (=3) More... | |
A simple 3D vector type.
This class is the template for a 3D vector that provides support for some common operators.
T | element type |
Definition at line 46 of file 3d/vector.hh.
typedef T T3DVector< T >::value_type |
typedef for generic programming
Definition at line 56 of file 3d/vector.hh.
standart constructor
Definition at line 59 of file 3d/vector.hh.
create a zero-vector, dim must be 3
Definition at line 62 of file 3d/vector.hh.
we provide the default copy mechanisms
constructor to construct vector from values
Definition at line 73 of file 3d/vector.hh.
|
inlineexplicit |
type casting copy constructor
Definition at line 78 of file 3d/vector.hh.
|
inline |
Fill the vector elements with value v.
Definition at line 109 of file 3d/vector.hh.
|
inline |
Definition at line 99 of file 3d/vector.hh.
Referenced by fabs().
|
inline |
square of Euclidian norm of the vector
Definition at line 90 of file 3d/vector.hh.
Referenced by T3DVector< T3DVector< T > >::norm().
inplace multiplication
Definition at line 164 of file 3d/vector.hh.
inplace component wise multiplication
Definition at line 170 of file 3d/vector.hh.
inplace addition
Definition at line 152 of file 3d/vector.hh.
inplace subtraction
Definition at line 158 of file 3d/vector.hh.
inplace divisison by a scalar
Definition at line 177 of file 3d/vector.hh.
we provide the default copy mechanisms
|
inline |
assignment from different vector type
Definition at line 84 of file 3d/vector.hh.
|
inline |
Implement the const operator [] for this type of vector
i | index |
Definition at line 121 of file 3d/vector.hh.
|
inline |
Implement the writable operator [] for this type of vector
i | index |
Definition at line 140 of file 3d/vector.hh.
|
inline |
Definition at line 95 of file 3d/vector.hh.
|
inline |
read the vector from a formatted string
Definition at line 189 of file 3d/vector.hh.
Referenced by operator>>().
|
inline |
Definition at line 104 of file 3d/vector.hh.
|
inline |
print out the formatted vector to the stream
Definition at line 184 of file 3d/vector.hh.
Referenced by operator<<().
swizzle operator
Definition at line 241 of file 3d/vector.hh.
swizzle operator
Definition at line 246 of file 3d/vector.hh.
swizzle operator
Definition at line 251 of file 3d/vector.hh.
swizzle operator
Definition at line 256 of file 3d/vector.hh.
swizzle operator
Definition at line 266 of file 3d/vector.hh.
swizzle operator
Definition at line 261 of file 3d/vector.hh.
declare the vector (0,0,0)
Definition at line 274 of file 3d/vector.hh.
declare the vector (1,1,1)
Definition at line 271 of file 3d/vector.hh.
|
static |
the number of elements this vector holds (=3)
Definition at line 277 of file 3d/vector.hh.
T T3DVector< T >::x |
vector element
Definition at line 49 of file 3d/vector.hh.
Referenced by cross(), T3DMatrix< T >::diagonal(), dot(), T3DVector< T3DVector< T > >::fill(), C3DCriticalPointEigen::get_complex_evect2(), C3DCriticalPointEigen::get_complex_evect3(), T3DMatrix< T >::get_eigenvalues(), T3DMatrix< T >::get_eigenvector(), T3DDatafield< T >::get_gradient(), T3DMatrix< T >::get_rank(), T3DVector< T3DVector< T > >::norm2(), FDeformer3D::operator()(), T3DDatafield< C3DFVector >::operator()(), T3DImage< T >::operator()(), less_then< T3DVector< T > >::operator()(), operator*(), T3DVector< T3DVector< T > >::operator*=(), operator+(), T3DVector< T3DVector< T > >::operator+=(), T3DVector< T3DVector< T > >::operator-=(), operator/(), T3DVector< T3DVector< T > >::operator/=(), T3DVector< T3DVector< T > >::operator=(), operator==(), operator>(), operator>=(), T3DVector< T3DVector< T > >::operator[](), operator^(), T3DVector< T3DVector< T > >::product(), T3DVector< T3DVector< T > >::read(), T3DVector< T3DVector< T > >::write(), Quaternion::x(), T3DVector< T3DVector< T > >::xzy(), T3DVector< T3DVector< T > >::yxz(), T3DVector< T3DVector< T > >::yzx(), T3DVector< T3DVector< T > >::zxy(), and T3DVector< T3DVector< T > >::zyx().
T T3DVector< T >::y |
vector element
Definition at line 51 of file 3d/vector.hh.
Referenced by cross(), T3DMatrix< T >::diagonal(), dot(), T3DVector< T3DVector< T > >::fill(), C3DCriticalPointEigen::get_complex_evect2(), C3DCriticalPointEigen::get_complex_evect3(), T3DMatrix< T >::get_eigenvalues(), T3DMatrix< T >::get_eigenvector(), T3DDatafield< T >::get_gradient(), T3DMatrix< T >::get_rank(), T3DVector< T3DVector< T > >::norm2(), FDeformer3D::operator()(), T3DDatafield< C3DFVector >::operator()(), T3DImage< T >::operator()(), less_then< T3DVector< T > >::operator()(), operator*(), T3DVector< T3DVector< T > >::operator*=(), operator+(), T3DVector< T3DVector< T > >::operator+=(), T3DVector< T3DVector< T > >::operator-=(), operator/(), T3DVector< T3DVector< T > >::operator/=(), T3DVector< T3DVector< T > >::operator=(), operator==(), operator>(), operator>=(), T3DVector< T3DVector< T > >::operator[](), operator^(), T3DVector< T3DVector< T > >::product(), T3DVector< T3DVector< T > >::read(), T3DVector< T3DVector< T > >::write(), T3DVector< T3DVector< T > >::xzy(), Quaternion::y(), T3DVector< T3DVector< T > >::yxz(), T3DVector< T3DVector< T > >::yzx(), T3DVector< T3DVector< T > >::zxy(), and T3DVector< T3DVector< T > >::zyx().
T T3DVector< T >::z |
vector element
Definition at line 53 of file 3d/vector.hh.
Referenced by cross(), T3DMatrix< T >::diagonal(), dot(), T3DVector< T3DVector< T > >::fill(), C3DCriticalPointEigen::get_complex_evect2(), C3DCriticalPointEigen::get_complex_evect3(), T3DMatrix< T >::get_eigenvalues(), T3DMatrix< T >::get_eigenvector(), T3DDatafield< T >::get_gradient(), T3DMatrix< T >::get_rank(), T3DVector< T3DVector< T > >::norm2(), FDeformer3D::operator()(), T3DDatafield< C3DFVector >::operator()(), T3DImage< T >::operator()(), less_then< T3DVector< T > >::operator()(), operator*(), T3DVector< T3DVector< T > >::operator*=(), operator+(), T3DVector< T3DVector< T > >::operator+=(), T3DVector< T3DVector< T > >::operator-=(), operator/(), T3DVector< T3DVector< T > >::operator/=(), T3DVector< T3DVector< T > >::operator=(), operator==(), operator>(), operator>=(), T3DVector< T3DVector< T > >::operator[](), operator^(), T3DVector< T3DVector< T > >::product(), T3DVector< T3DVector< T > >::read(), T3DVector< T3DVector< T > >::write(), T3DVector< T3DVector< T > >::xzy(), T3DVector< T3DVector< T > >::yxz(), T3DVector< T3DVector< T > >::yzx(), Quaternion::z(), T3DVector< T3DVector< T > >::zxy(), and T3DVector< T3DVector< T > >::zyx().