[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]
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 std::ptrdiff_t | 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 |
Static Public Member Functions | |
static TinyVector< VALUETYPE, SIZE > | linearSequence (VALUETYPE start=VALUETYPE(), VALUETYPE step=VALUETYPE(1)) |
Factory function for a linear sequence. | |
static TinyVector< VALUETYPE, SIZE > | unitVector (int k) |
Factory function for a unit vector for dimension k. | |
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
STL-compatible definition of valuetype
reference (return of operator[]).
const reference (return of operator[] const).
pointer (return of operator->).
const pointer (return of operator-> const).
STL-compatible definition of iterator
STL-compatible definition of const iterator
STL-compatible definition of size_type
typedef std::ptrdiff_t difference_type |
STL-compatible definition of difference_type
the scalar type for the outer product
typedef NormTraits<VALUETYPE>::SquaredNormType SquaredNormType |
the vector's squared norm type
typedef SquareRootTraits<SquaredNormType>::SquareRootResult NormType |
the vector's norm type
Initialize from another sequence (must have length SIZE!)
Initialize with constant value
Component-wise subtract-assignment
Component-wise multiply-assignment
Component-wise divide-assignment
Component-wise modulo-assignment
Component-wise scalar multiply-assignment
Component-wise scalar divide-assignment
Component-wise scalar multiply-assignment
Component-wise scalar divide-assignment
Calculate magnitude (i.e. 2-norm / Euclidean norm / length).
SquaredNormType squaredMagnitude | ( | ) | const |
Calculate squared magnitude (i.e. sum of squared elements).
Check that all elements of this vector are non-zero (or 'true' if T is bool).
Check that at least one element of this vector is non-zero (or 'true' if T is bool).
reference operator[] | ( | difference_type | i | ) |
Access component by index.
const_reference operator[] | ( | difference_type | i | ) | const |
Get component by index.
Get random access iterator to begin of vector.
Get random access iterator past-the-end of vector.
Get const random access iterator to begin of vector.
Get const random access iterator past-the-end of vector.
Get const random access iterator to begin of vector.
Get const random access iterator past-the-end of vector.
TinyVectorView< VALUETYPE, TO-FROM > subarray | ( | ) | const |
Get a view to the subarray with length (TO-FROM)
starting at FROM
. The bounds must fullfill 0 <= FROM < TO <= SIZE
, but this is only checked when VIGRA_CHECK_BOUNDS
is #define'd.
Size of TinyVector vector always equals the template parameter SIZE.
|
static |
Factory function for a linear sequence.
The result will be initialized as res[k] = start + k*step
.
© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de) |