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

TinyVector< T, SIZE > Class Template Reference

Class for fixed size vectors. More...

#include <vigra/tinyvector.hxx>

Inheritance diagram for TinyVector< T, SIZE >:
TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > > RGBValue< element_promote_type > RGBValue< typename NumericTraits< T >::Promote, R, G, B > RGBValue< typename NumericTraits< T >::RealPromote, R, G, B > RGBValue< typename NumericTraits< T >::ComplexPromote, R, G, B > RGBValue< typename PromoteTraits< T1, T2 >::Promote, R, G, B > RGBValue< ComponentType >

Public Member Functions

template<class U, int USIZE, class DATA, class DERIVED>
TinyVectorcopy (TinyVectorBase< U, USIZE, DATA, DERIVED > const &r)
TinyVectoroperator= (Diff2D const &r)
TinyVectoroperator= (TinyVector const &r)
template<class U, class DATA, class DERIVED>
TinyVectoroperator= (TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
TinyVectoroperator= (value_type const &v)
 TinyVector ()
 TinyVector (const_pointer data, ReverseCopyTag)
 TinyVector (Diff2D const &initial)
 TinyVector (lemon::Invalid const &)
 TinyVector (SkipInitializationTag)
 TinyVector (TinyVector const &r)
template<class U, class DATA, class DERIVED>
 TinyVector (TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
template<class U>
 TinyVector (U const *data)
 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 (value_type const &initial)
Public Member Functions inherited from TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >
bool all () const
bool any () const
iterator begin ()
const_iterator begin () const
const_iterator cbegin () const
const_iterator cend () const
iterator end ()
const_iterator end () const
void init (Iterator i, Iterator end)
void init (value_type initial)
NormType magnitude () const
T const & maximum () const
T const & minimum () 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+= (double r)
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/= (double r)
TinyVector< T, SIZE > & operator/= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
reference operator[] (difference_type i)
const_reference operator[] (difference_type i) const
size_type size () const
SquaredNormType squaredMagnitude () const
TinyVectorView< T, TO-FROM > subarray () const

Additional Inherited Members

Public Types inherited from TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >
enum  
typedef value_type const * const_iterator
typedef T const * const_pointer
typedef T const & const_reference
typedef std::ptrdiff_t 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
Static Public Member Functions inherited from TinyVectorBase< T, SIZE, T[SIZE], TinyVector< T, SIZE > >
static TinyVector< T, SIZE > linearSequence (T start=T(), T step=T(1))
 Factory function for a linear sequence.
static TinyVector< T, SIZE > unitVector (int k)
 Factory function for a unit vector for dimension k.

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 VectorAccessor to access TinyVectors as a whole, or specific components of them.

See also:

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

Examples
palette.cxx.

Constructor & Destructor Documentation

◆ TinyVector() [1/13]

template<class T, int SIZE>
TinyVector ( value_type const & initial)
explicit

Construction with constant value.

Initializes all vector elements with the given value.

◆ TinyVector() [2/13]

template<class T, int SIZE>
TinyVector ( lemon::Invalid const & )

Construction from lemon::Invalid.

Initializes all vector elements with -1.

◆ TinyVector() [3/13]

template<class T, int SIZE>
TinyVector ( Diff2D const & initial)
explicit

Construction with Diff2D.

Use only when SIZE == 2.

◆ TinyVector() [4/13]

template<class T, int SIZE>
TinyVector ( value_type const & i1,
value_type const & i2 )

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

◆ TinyVector() [5/13]

template<class T, int SIZE>
TinyVector ( value_type const & i1,
value_type const & i2,
value_type const & i3 )

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

◆ TinyVector() [6/13]

template<class T, int SIZE>
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() [7/13]

template<class T, int SIZE>
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

◆ TinyVector() [8/13]

template<class T, int SIZE>
TinyVector ( )

Default constructor (initializes all elements with zero).

◆ TinyVector() [9/13]

template<class T, int SIZE>
TinyVector ( SkipInitializationTag )
explicit

Construct without initializing the vector elements.

◆ TinyVector() [10/13]

template<class T, int SIZE>
TinyVector ( TinyVector< T, SIZE > const & r)

Copy constructor.

◆ TinyVector() [11/13]

template<class T, int SIZE>
template<class U>
TinyVector ( U const * data)
explicit

Constructor from C array.

◆ TinyVector() [12/13]

template<class T, int SIZE>
TinyVector ( const_pointer data,
ReverseCopyTag  )
explicit

Constructor by reverse copy from C array.

Usage:

TinyVector(value_type const &initial)
Definition tinyvector.hxx:1031

◆ TinyVector() [13/13]

template<class T, int SIZE>
template<class U, class DATA, class DERIVED>
TinyVector ( TinyVectorBase< U, SIZE, DATA, DERIVED > const & r)

Copy with type conversion.

Member Function Documentation

◆ operator=() [1/4]

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

Copy assignment.

◆ operator=() [2/4]

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

Copy assignment with type conversion.

◆ operator=() [3/4]

template<class T, int SIZE>
TinyVector & operator= ( Diff2D const & r)

Assignment from Diff2D.

Use only when SIZE == 2.

◆ operator=() [4/4]

template<class T, int SIZE>
TinyVector & operator= ( value_type const & v)

Assignment from scalar. Will set all entries to the given value.

◆ copy()

template<class T, int SIZE>
template<class U, int USIZE, class DATA, class DERIVED>
TinyVector & copy ( TinyVectorBase< U, USIZE, DATA, DERIVED > const & r)

Copy from a TinyVector with a different number of elements.

Only the first min(SIZE, USIZE) elements are copied.


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

© 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.12.3 ()