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

TinyVectorView< T, SIZE > Class Template Reference

Wrapper for fixed size vectors. More...

#include <vigra/tinyvector.hxx>

Inheritance diagram for TinyVectorView< T, SIZE >:
TinyVectorBase< T, SIZE, T *, TinyVectorView< T, SIZE > >

Public Member Functions

template<class U, class DATA, class DERIVED>
TinyVectorViewoperator= (TinyVectorBase< U, SIZE, DATA, DERIVED > const &r)
TinyVectorViewoperator= (TinyVectorView const &r)
 TinyVectorView ()
 TinyVectorView (const_pointer data)
template<class DATA, class DERIVED>
 TinyVectorView (TinyVectorBase< T, SIZE, DATA, DERIVED > const &other)
 TinyVectorView (TinyVectorView const &other)
Public Member Functions inherited from TinyVectorBase< T, SIZE, T *, TinyVectorView< 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
TinyVectorView< T, SIZE > & operator%= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVectorView< T, SIZE > & operator*= (double r)
TinyVectorView< T, SIZE > & operator*= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVectorView< T, SIZE > & operator+= (double r)
TinyVectorView< T, SIZE > & operator+= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVectorView< T, SIZE > & operator-= (double r)
TinyVectorView< T, SIZE > & operator-= (TinyVectorBase< T1, SIZE, D1, D2 > const &r)
TinyVectorView< T, SIZE > & operator/= (double r)
TinyVectorView< 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 *, TinyVectorView< 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 *, TinyVectorView< 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::TinyVectorView< T, SIZE >

Wrapper for fixed size vectors.

This class wraps an array of size SIZE of the specified VALUETYPE. Thus, the array can be accessed with an interface similar to that of std::vector (except that there are no functions that change the size of a TinyVectorView). The TinyVectorView does not assume ownership of the given memory.

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

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

See also:

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

Constructor & Destructor Documentation

◆ TinyVectorView() [1/4]

template<class T, int SIZE>
TinyVectorView ( )

Default constructor (pointer to wrapped data is NULL).

◆ TinyVectorView() [2/4]

template<class T, int SIZE>
TinyVectorView ( const_pointer data)

Construct view for given data array

◆ TinyVectorView() [3/4]

template<class T, int SIZE>
TinyVectorView ( TinyVectorView< T, SIZE > const & other)

Copy constructor (shallow copy).

◆ TinyVectorView() [4/4]

template<class T, int SIZE>
template<class DATA, class DERIVED>
TinyVectorView ( TinyVectorBase< T, SIZE, DATA, DERIVED > const & other)

Construct view from other TinyVector.

Member Function Documentation

◆ operator=() [1/2]

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

Copy the data (not the pointer) of the rhs.

◆ operator=() [2/2]

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

Copy the data of the rhs with cast.


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.12.3