[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
![]() |
TinyVectorBase< VALUETYPE, SIZE, DATA, DERIVED > | ![]() |
Base class for fixed size vectors. More...
#include <vigra/tinyvector.hxx>
Public Types | |
enum | |
typedef value_type const * | const_iterator |
typedef VALUETYPE const * | const_pointer |
typedef VALUETYPE const & | const_reference |
typedef int | difference_type |
typedef value_type * | iterator |
typedef SquareRootTraits < SquaredNormType > ::SquareRootResult | NormType |
typedef VALUETYPE * | pointer |
typedef VALUETYPE & | reference |
typedef double | scalar_multiplier |
typedef unsigned int | size_type |
typedef NormTraits< VALUETYPE > ::SquaredNormType | SquaredNormType |
typedef VALUETYPE | value_type |
Public Member Functions | |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
void | init (value_type initial) |
template<class Iterator > | |
void | init (Iterator i, Iterator end) |
NormType | magnitude () const |
DERIVED & | operator*= (double r) |
template<class T1 , class D1 , class D2 > | |
DERIVED & | operator*= (TinyVectorBase< T1, SIZE, D1, D2 > const &r) |
template<class T1 , class D1 , class D2 > | |
DERIVED & | operator+= (TinyVectorBase< T1, SIZE, D1, D2 > const &r) |
template<class T1 , class D1 , class D2 > | |
DERIVED & | operator-= (TinyVectorBase< T1, SIZE, D1, D2 > const &r) |
DERIVED & | operator/= (double r) |
template<class T1 , class D1 , class D2 > | |
DERIVED & | operator/= (TinyVectorBase< T1, SIZE, D1, D2 > const &r) |
const_reference | operator[] (difference_type i) const |
reference | operator[] (difference_type i) |
size_type | size () const |
SquaredNormType | squaredMagnitude () const |
Base class for fixed size vectors.
This class contains functionality shared by TinyVector and TinyVectorView, and enables these classes to be freely mixed within expressions. It is typically not used directly.
#include <vigra/tinyvector.hxx>
Namespace: vigra
typedef VALUETYPE value_type |
STL-compatible definition of valuetype
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef VALUETYPE& reference |
reference (return of operator[]).
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef VALUETYPE const& const_reference |
const reference (return of operator[] const).
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef VALUETYPE* pointer |
pointer (return of operator->).
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef VALUETYPE const* const_pointer |
const pointer (return of operator-> const).
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef value_type* iterator |
STL-compatible definition of iterator
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef value_type const* const_iterator |
STL-compatible definition of const iterator
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef unsigned int size_type |
STL-compatible definition of size_type
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef int difference_type |
STL-compatible definition of difference_type
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef double scalar_multiplier |
the scalar type for the outer product
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef NormTraits<VALUETYPE>::SquaredNormType SquaredNormType |
the vector's squared norm type
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
typedef SquareRootTraits<SquaredNormType>::SquareRootResult NormType |
the vector's norm type
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >, TinyVector< T, SIZE >, TinyVectorView< T, SIZE >, TinyVector< ValueType, 3 >, TinyVector< double, 2 >, TinyVector< VALUETYPE, 3 >, TinyVector< float, 3 >, and TinyVector< VALUETYPE, DIMENSION >.
anonymous enum |
the vector's size
void init | ( | Iterator | i, | |
Iterator | end | |||
) |
Initialize from another sequence (must have length SIZE!)
void init | ( | value_type | initial | ) |
Initialize with constant value
DERIVED& operator+= | ( | TinyVectorBase< T1, SIZE, D1, D2 > const & | r | ) |
Component-wise add-assignment
DERIVED& operator-= | ( | TinyVectorBase< T1, SIZE, D1, D2 > const & | r | ) |
Component-wise subtract-assignment
DERIVED& operator*= | ( | TinyVectorBase< T1, SIZE, D1, D2 > const & | r | ) |
Component-wise multiply-assignment
DERIVED& operator/= | ( | TinyVectorBase< T1, SIZE, D1, D2 > const & | r | ) |
Component-wise divide-assignment
DERIVED& operator*= | ( | double | r | ) |
Component-wise scalar multiply-assignment
DERIVED& operator/= | ( | double | r | ) |
Component-wise scalar divide-assignment
NormType magnitude | ( | ) | const |
Calculate magnitude.
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >.
SquaredNormType squaredMagnitude | ( | ) | const |
Calculate squared magnitude.
Reimplemented in RGBValue< VALUETYPE, RED_IDX, GREEN_IDX, BLUE_IDX >.
reference operator[] | ( | difference_type | i | ) |
Access component by index.
const_reference operator[] | ( | difference_type | i | ) | const |
Get component by index.
iterator begin | ( | ) |
Get random access iterator to begin of vector.
iterator end | ( | ) |
Get random access iterator past-the-end of vector.
const_iterator begin | ( | ) | const |
Get const random access iterator to begin of vector.
const_iterator end | ( | ) | const |
Get const random access iterator past-the-end of vector.
size_type size | ( | ) | const |
Size of TinyVector vector always equals the template parameter SIZE.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |
html generated using doxygen and Python
|