soma-io
5.1.2
|
The template class to implement basic vectors. More...
#include <soma-io/vector/vector.h>
Public Types | |
typedef T | value_type |
Public Member Functions | |
Constructors and Destructor | |
AimsVector () | |
The constructor allocates an appropriate amount of memory. More... | |
AimsVector (const std::vector< T > &value) | |
AimsVector (const T &value) | |
The constructor fills the D items of vector with value. More... | |
AimsVector (const T value[]) | |
The constructor copy the D item of value[]. More... | |
AimsVector (const T &x, const T &y) | |
Constructor for D=2. More... | |
AimsVector (const T &x, const T &y, const T &z) | |
Constructor for D=3. More... | |
AimsVector (const T &x, const T &y, const T &z, const T &t) | |
Constructor for D=4. More... | |
AimsVector (const AimsVector< T, D > &other) | |
Copy constructor. More... | |
template<class U > | |
AimsVector (const AimsVector< U, D > &other) | |
Type conversion. More... | |
~AimsVector () | |
The destructor deletes the allocated memory space. More... | |
Manipulators and methods | |
AimsVector< T, D > & | operator= (const AimsVector< T, D > &other) |
AimsVector< T, D > & | operator+= (const AimsVector< T, D > &other) |
AimsVector< T, D > & | operator-= (const AimsVector< T, D > &other) |
AimsVector< T, D > & | operator*= (double val) |
AimsVector< T, D > & | operator/= (double val) |
AimsVector< T, D > & | normalize () |
const T & | item (int d) const |
Get a const reference to the dth item. More... | |
const T & | operator[] (int d) const |
Get a const reference to the dth item. More... | |
T & | item (int d) |
Get a non const reference to the dth item. More... | |
T & | operator[] (int d) |
Get a const reference to the dth item. More... | |
int | size () const |
bool | isNull () const |
Test if the vector is the null vector. More... | |
float | norm () const |
Return the magnitude of the vector. More... | |
float | norm2 () const |
Return the square magnitude of the vector. More... | |
double | dnorm () const |
Return the magnitude of the vector. More... | |
double | dnorm2 () const |
Return the square magnitude of the vector. More... | |
T | dot (const AimsVector< T, D > &other) const |
Get the dot product between 2 vectors. More... | |
Useful type definitions | |
std::vector< T > | toStdVector () const |
Protected Attributes | |
T | _value [D] |
Memory space allocated. More... | |
Iterators | |
typedef T * | iterator |
typedef const T * | const_iterator |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
The template class to implement basic vectors.
The first template argument provides the type of stored items and the second template argument provides the size of the vector.
typedef const T* AimsVector< T, D >::const_iterator |
typedef T* AimsVector< T, D >::iterator |
typedef T AimsVector< T, D >::value_type |
|
inline |
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inline |
Constructor for D=2.
Definition at line 619 of file vector.h.
References internal::fill_aimsvector2< T, D >::doit().
|
inline |
Constructor for D=3.
Definition at line 627 of file vector.h.
References internal::fill_aimsvector3< T, D >::doit().
|
inline |
Constructor for D=4.
Definition at line 635 of file vector.h.
References internal::fill_aimsvector4< T, D >::doit().
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
Definition at line 202 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
Definition at line 203 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
|
inline |
|
inline |
Get the dot product between 2 vectors.
Definition at line 824 of file vector.h.
References AimsVector< T, D >::item().
|
inline |
Definition at line 204 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
Definition at line 205 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
|
inline |
|
inline |
Get a const reference to the dth item.
Definition at line 731 of file vector.h.
References ASSERT.
Referenced by AimsVector< T, D >::dot(), operator<<(), operator==(), and operator>>().
|
inline |
|
inline |
|
inline |
Definition at line 719 of file vector.h.
References norm().
Referenced by soma::AffineTransformation3dBase::transformUnitNormal().
|
inline |
|
inline |
Definition at line 679 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
Definition at line 689 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
|
inline |
Definition at line 660 of file vector.h.
References AimsVector< T, D >::_value.
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Memory space allocated.
Definition at line 214 of file vector.h.
Referenced by AimsVector< T, D >::AimsVector(), AimsVector< T, D >::begin(), AimsVector< T, D >::end(), AimsVector< T, D >::operator+=(), AimsVector< T, D >::operator-=(), and AimsVector< T, D >::operator=().