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

| Functions for TinyVector |

Implement basic arithmetic and equality for TinyVector. More...

## Functions

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | abs (TinyVectorBase< V, SIZE, D1, D2 > const &v)
| component-wise absolute value
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | allGreater (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| pointwise greater-than
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | allGreaterEqual (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| pointwise greater-equal
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | allLess (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| pointwise less-than
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | allLessEqual (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| pointwise less-equal
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | ceil (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V , int SIZE>
TinyVector< V, SIZE > | clip (TinyVector< V, SIZE > const &t, const V valLower, const V valUpper)
| Clip values to an interval. More...
template<class V , int SIZE>
TinyVector< V, SIZE > | clip (TinyVector< V, SIZE > const &t, TinyVector< V, SIZE > const &valLower, TinyVector< V, SIZE > const &valUpper)
| Clip values to a vector of intervals. More...
template<class V , int SIZE>
TinyVector< V, SIZE > | clipLower (TinyVector< V, SIZE > const &t)
| Clip negative values. More...
template<class V , int SIZE>
TinyVector< V, SIZE > | clipLower (TinyVector< V, SIZE > const &t, const V val)
| Clip values below a threshold. More...
template<class V , int SIZE>
TinyVector< V, SIZE > | clipUpper (TinyVector< V, SIZE > const &t, const V val)
| Clip values above a threshold. More...
template<class V1 , class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, 3 > | cross (TinyVectorBase< V1, 3, D1, D2 > const &r1, TinyVectorBase< V2, 3, D3, D4 > const &r2)
| cross product
template<class V , int SIZE, class D1 , class D2 >
TinyVector< typename NumericTraits< V >::Promote, SIZE > | cumprod (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| cumulative product of the vector's elements
template<class V , int SIZE, class D1 , class D2 >
TinyVector< typename NumericTraits< V >::Promote, SIZE > | cumsum (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| cumulative sum of the vector's elements
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | div (TinyVectorBase< V, SIZE, D1, D2 > const &l, V v)
| component-wise scalar division without type promotion
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< V1, V2 >::Promote | dot (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| dot product
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | floor (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, SIZE > | max (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| element-wise maximum
template<class V , int SIZE, class D1 , class D2 >
V const & | max (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| maximum element
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, SIZE > | min (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| element-wise minimum
template<class V , int SIZE, class D1 , class D2 >
V const & | min (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| minimum element
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | operator!= (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise not equal
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote | operator% (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise modulo
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote | operator* (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise multiplication
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator* (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
| component-wise left scalar multiplication
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator* (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
| component-wise right scalar multiplication
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote | operator+ (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise addition
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator+ (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
| component-wise left scalar addition
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator+ (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
| component-wise right scalar addition
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote | operator- (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise subtraction
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator- (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
| component-wise left scalar subtraction
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator- (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
| component-wise right scalar subtraction
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | operator- (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote | operator/ (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise division
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator/ (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
| component-wise left scalar division
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote | operator/ (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
| component-wise right scalar division
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | operator< (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| lexicographical comparison
template<class V1 , int SIZE, class DATA , class DERIVED >
std::ostream & | operator<< (std::ostream &out, TinyVectorBase< V1, SIZE, DATA, DERIVED > const &l)
| stream output
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool | operator== (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
| component-wise equal
template<class V , int SIZE, class D1 , class D2 , class E >
TinyVector< V, SIZE > | pow (TinyVectorBase< V, SIZE, D1, D2 > const &v, E exponent)
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< V >::Promote | prod (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| product of the vector's elements
template<class V , int SIZE>
TinyVector< V, SIZE > | reverse (TinyVector< V, SIZE > const &t)
| reversed copy
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | round (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V , int SIZE, class D1 , class D2 >
TinyVector< std::ptrdiff_t, SIZE > | roundi (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > | sqrt (TinyVectorBase< V, SIZE, D1, D2 > const &v)
template<class V1 , int SIZE, class D1 , class D2 >
TinyVectorBase< V1, SIZE, D1, D2 >::SquaredNormType | squaredNorm (TinyVectorBase< V1, SIZE, D1, D2 > const &t)
| squared norm
template<class V , int SIZE>
TinyVector< V, SIZE >::SquaredNormType | squaredNorm (TinyVector< V, SIZE > const &t)
| squared norm
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< V >::Promote | sum (TinyVectorBase< V, SIZE, D1, D2 > const &l)
| sum of the vector's elements
template<class V , int SIZE, class T >
TinyVector< V, SIZE > | transpose (TinyVector< V, SIZE > const &t, TinyVector< T, SIZE > const &permutation)
| transposed copy More...

## Detailed Description

Implement basic arithmetic and equality for TinyVector.

These functions fulfill the requirements of a Linear Space (vector space). Return types are determined according to Numeric and Promote Traits of TinyVector.

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

## Function Documentation

## ◆ operator-()

TinyVector<V, SIZE> vigra::operator- | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Unary negation (construct TinyVector with negative values)

## ◆ ceil()

TinyVector<V, SIZE> vigra::ceil | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Apply ceil() function to each vector component.

## ◆ floor()

TinyVector<V, SIZE> vigra::floor | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Apply floor() function to each vector component.

## ◆ round()

TinyVector<V, SIZE> vigra::round | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Apply round() function to each vector component.

## ◆ roundi()

TinyVector<std::ptrdiff_t, SIZE> vigra::roundi | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Apply roundi() function to each vector component, i.e. return an integer vector.

## ◆ sqrt()

TinyVector<V, SIZE> vigra::sqrt | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v | ) |

Apply sqrt() function to each vector component.

## ◆ pow()

TinyVector<V, SIZE> vigra::pow | ( | TinyVectorBase< V, SIZE, D1, D2 > const & | v,
|  | E | exponent
| ) |  |

Apply pow() function to each vector component.

## ◆ transpose()

TinyVector<V, SIZE> vigra::transpose | ( | TinyVector< V, SIZE > const & | t,
|  | TinyVector< T, SIZE > const & | permutation
| ) |  |

transposed copy

Elements are arranged such that `res[k] = t[permutation[k]]`.

## ◆ clipLower() [1/2]

TinyVector<V, SIZE> vigra::clipLower | ( | TinyVector< V, SIZE > const & | t | ) |

Clip negative values.

All elements smaller than 0 are set to zero.

## ◆ clipLower() [2/2]

TinyVector<V, SIZE> vigra::clipLower | ( | TinyVector< V, SIZE > const & | t,
|  | const V | val
| ) |  |

Clip values below a threshold.

All elements smaller than val are set to val.

## ◆ clipUpper()

TinyVector<V, SIZE> vigra::clipUpper | ( | TinyVector< V, SIZE > const & | t,
|  | const V | val
| ) |  |

Clip values above a threshold.

All elements bigger than val are set to val.

## ◆ clip() [1/2]

TinyVector<V, SIZE> vigra::clip | ( | TinyVector< V, SIZE > const & | t,
|  | const V | valLower,
|  | const V | valUpper
| ) |  |

Clip values to an interval.

All elements less than valLower are set to valLower, all elements bigger than valUpper are set to valUpper.

## ◆ clip() [2/2]

TinyVector<V, SIZE> vigra::clip | ( | TinyVector< V, SIZE > const & | t,
|  | TinyVector< V, SIZE > const & | valLower,
|  | TinyVector< V, SIZE > const & | valUpper
| ) |  |

Clip values to a vector of intervals.

All elements less than valLower are set to valLower, all elements bigger than valUpper are set to valUpper.

© 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.11.0