|
soma-io 6.0.6
|
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. | |
| AimsVector (const std::vector< T > &value) | |
| AimsVector (const T &value) | |
| The constructor fills the D items of vector with value. | |
| AimsVector (const T value[]) | |
| The constructor copy the D item of value[]. | |
| AimsVector (const T &x, const T &y) | |
| Constructor for D=2. | |
| AimsVector (const T &x, const T &y, const T &z) | |
| Constructor for D=3. | |
| AimsVector (const T &x, const T &y, const T &z, const T &t) | |
| Constructor for D=4. | |
| AimsVector (const AimsVector< T, D > &other) | |
| Copy constructor. | |
| template<class U> | |
| AimsVector (const AimsVector< U, D > &other) | |
| Type conversion. | |
| ~AimsVector () | |
| The destructor deletes the allocated memory space. | |
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. | |
| const T & | operator[] (int d) const |
| Get a const reference to the dth item. | |
| T & | item (int d) |
| Get a non const reference to the dth item. | |
| T & | operator[] (int d) |
| Get a const reference to the dth item. | |
| int | size () const |
| bool | isNull () const |
| Test if the vector is the null vector. | |
| float | norm () const |
| Return the magnitude of the vector. | |
| float | norm2 () const |
| Return the square magnitude of the vector. | |
| double | dnorm () const |
| Return the magnitude of the vector. | |
| double | dnorm2 () const |
| Return the square magnitude of the vector. | |
| T | dot (const AimsVector< T, D > &other) const |
| Get the dot product between 2 vectors. | |
Useful type definitions | |
| std::vector< T > | toStdVector () const |
Protected Attributes | |
| T | _value [D] |
| Memory space allocated. | |
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 |
The constructor allocates an appropriate amount of memory.
Definition at line 435 of file vector.h.
Referenced by AimsVector(), AimsVector(), dot(), normalize(), operator*=(), operator+=(), operator-=(), operator/=(), and operator=().
|
inlineexplicit |
|
inline |
|
inlineexplicit |
|
inline |
Constructor for D=2.
Definition at line 619 of file vector.h.
References _value, and internal::fill_aimsvector2< T, D >::doit().
|
inline |
Constructor for D=3.
Definition at line 627 of file vector.h.
References _value, and internal::fill_aimsvector3< T, D >::doit().
|
inline |
Constructor for D=4.
Definition at line 635 of file vector.h.
References _value, and internal::fill_aimsvector4< T, D >::doit().
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get the dot product between 2 vectors.
Definition at line 824 of file vector.h.
References AimsVector(), and item().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get a const reference to the dth item.
Definition at line 731 of file vector.h.
References _value.
Referenced by dnorm(), dnorm2(), dot(), norm(), norm2(), operator<<(), operator<<(), operator<<(), operator==(), operator>>(), operator>>(), operator>>(), and toStdVector().
|
inline |
|
inline |
|
inline |
Definition at line 719 of file vector.h.
References AimsVector(), and norm().
|
inline |
Definition at line 699 of file vector.h.
References _value, and AimsVector().
|
inline |
Definition at line 679 of file vector.h.
References _value, and AimsVector().
|
inline |
Definition at line 689 of file vector.h.
References _value, and AimsVector().
|
inline |
Definition at line 709 of file vector.h.
References _value, and AimsVector().
|
inline |
Definition at line 660 of file vector.h.
References _value, and AimsVector().
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Memory space allocated.
Definition at line 214 of file vector.h.
Referenced by AimsVector(), AimsVector(), AimsVector(), AimsVector(), AimsVector(), AimsVector(), AimsVector(), AimsVector(), isNull(), item(), item(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), operator[](), and operator[]().