[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

Public Member Functions | List of all members
TinyVector< T, SIZE > Class Template Reference

Class for fixed size vectors.This class contains an array of size SIZE of the specified VALUETYPE. The interface conforms to STL vector, except that there are no functions that change the size of a TinyVector. More...

#include <vigra/tinyvector.hxx>

Inheritance diagram for TinyVector< T, SIZE >:
TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >

Public Member Functions

TinyVectoroperator= (TinyVector const &r)
TinyVectoroperator= (Diff2D const &r)
template<class U , class DATA , class DERIVED >
TinyVectoroperator= (TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
 TinyVector (value_type const &initial)
 TinyVector (Diff2D const &initial)
 TinyVector (value_type const &i1, value_type const &i2)
 TinyVector (value_type const &i1, value_type const &i2, value_type const &i3)
 TinyVector (value_type const &i1, value_type const &i2, value_type const &i3, value_type const &i4)
 TinyVector (value_type const &i1, value_type const &i2, value_type const &i3, value_type const &i4, value_type const &i5)
 TinyVector ()
 TinyVector (TinyVector const &r)
 TinyVector (const_pointer data)
 TinyVector (const_pointer data, ReverseCopyTag)
template<class U >
 TinyVector (TinyVector< U, SIZE > const &r)
template<class U , class DATA , class DERIVED >
 TinyVector (TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
- Public Member Functions inherited from TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const
void init (Iterator i, Iterator end)
void init (value_type initial)
NormType magnitude () const
TinyVector< T, SIZE > & operator*= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVector< T, SIZE > & operator*= (double r)
TinyVector< T, SIZE > & operator+= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVector< T, SIZE > & operator-= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVector< T, SIZE > & operator/= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVector< T, SIZE > & operator/= (double r)
reference operator[] (difference_type i)
const_reference operator[] (difference_type i) const
size_type size () const
SquaredNormType squaredMagnitude () const

Additional Inherited Members

- Public Types inherited from TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >
enum  
typedef value_type const * const_iterator
typedef Tconst * const_pointer
typedef Tconst & const_reference
typedef int difference_type
typedef value_typeiterator
typedef SquareRootTraits
< SquaredNormType >
::SquareRootResult 
NormType
typedef T * pointer
typedef T & reference
typedef double scalar_multiplier
typedef unsigned int size_type
typedef NormTraits< T >
::SquaredNormType 
SquaredNormType
typedef T value_type

Detailed Description

template<class T, int SIZE>
class vigra::TinyVector< T, SIZE >

Class for fixed size vectors.

This class contains an array of size SIZE of the specified VALUETYPE. The interface conforms to STL vector, except that there are no functions that change the size of a TinyVector.

Arithmetic operations on TinyVectors are defined as component-wise applications of these operations. Addition and subtraction of two TinyVectors (+=, -=, +, -, unary -), multiplication and division of an TinyVector with a double, and NumericTraits/PromoteTraits are defined, so that TinyVector fulfills the requirements of Linear Algebra.

VIGRA algorithms typically use vigra::VectorAccessor to access TinyVectors as a whole, or specific components of them.

See also:

#include <vigra/tinyvector.hxx>
Namespace: vigra

Constructor & Destructor Documentation

TinyVector ( value_type const &  initial)
explicit

Construction with constant value

TinyVector ( Diff2D const &  initial)
explicit

Construction with Diff2D (only implemented for 2D TinyVector)

TinyVector ( value_type const &  i1,
value_type const &  i2 
)

Construction with explicit values. Call only if SIZE == 2

TinyVector ( value_type const &  i1,
value_type const &  i2,
value_type const &  i3 
)

Construction with explicit values. Call only if SIZE == 3

TinyVector ( value_type const &  i1,
value_type const &  i2,
value_type const &  i3,
value_type const &  i4 
)

Construction with explicit values. Call only if SIZE == 4

TinyVector ( value_type const &  i1,
value_type const &  i2,
value_type const &  i3,
value_type const &  i4,
value_type const &  i5 
)

Construction with explicit values. Call only if SIZE == 5

Default constructor (initializes all components with zero)

TinyVector ( TinyVector< T, SIZE > const &  r)

Copy constructor.

TinyVector ( const_pointer  data)
explicit

Constructor from C array.

TinyVector ( const_pointer  data,
ReverseCopyTag   
)
explicit

Constructor by reverse copy from C array.

Usage:

TinyVector<int, 3> v(1,2,3);
TinyVector<int, 3> reverse(v.begin(), TinyVector<int, 3>::ReverseCopy);
TinyVector ( TinyVector< U, SIZE > const &  r)

Copy with type conversion.

TinyVector ( TinyVectorBase< U, SIZE, DATA, DERIVED > const &  r)

Copy with type conversion.

Member Function Documentation

TinyVector& operator= ( TinyVector< T, SIZE > const &  r)

Copy assignment.

TinyVector& operator= ( Diff2D const &  r)

Assignment from Diff2D.

TinyVector& operator= ( TinyVectorBase< U, SIZE, DATA, DERIVED > const &  r)

Copy assignment with type conversion.


The documentation for this class was generated from the following file:

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.7.1 (Wed Mar 12 2014)