#include <fixed_vector.h>
Public Types | |
typedef C | value_type |
typedef value_type * | pointer |
typedef const value_type * | const_pointer |
typedef value_type * | iterator |
typedef const value_type * | const_iterator |
typedef value_type & | reference |
typedef const value_type & | const_reference |
typedef unsigned int | size_type |
Public Member Functions | |
FixedVector () | |
FixedVector (const C) | |
FixedVector (const FixedVector< C, SIZE > &v) | |
virtual | ~FixedVector () |
size_type | size () const |
FixedVector< C, SIZE > & | operator= (const FixedVector< C, SIZE > &v) |
FixedVector< C, SIZE > & | operator= (const C c) |
const C | operator[] (const size_type i) const |
const C | operator() (const size_type i) const |
C & | operator[] (const size_type i) |
C & | operator() (const size_type i) |
const_iterator | begin () const |
iterator | begin () |
const_iterator | end () const |
iterator | end () |
template<class C2 > | |
bool | operator== (const FixedVector< C2, SIZE > &v) const |
template<class C2 > | |
bool | operator!= (const FixedVector< C2, SIZE > &v) const |
template<class C2 > | |
bool | operator< (const FixedVector< C2, SIZE > &v) const |
template<class C2 > | |
void | add (const FixedVector< C2, SIZE > &v) |
template<class C2 > | |
void | add (const C2 s, const FixedVector< C2, SIZE > &v) |
template<class C2 > | |
void | sadd (const C s, const FixedVector< C2, SIZE > &v) |
void | scale (const C s) |
template<class C2 > | |
FixedVector< C, SIZE > & | operator+= (const FixedVector< C2, SIZE > &v) |
template<class C2 > | |
void | subtract (const FixedVector< C2, SIZE > &v) |
template<class C2 > | |
FixedVector< C, SIZE > & | operator-= (const FixedVector< C2, SIZE > &v) |
template<class C2 > | |
const C | inner_product (const FixedVector< C2, SIZE > &v) const |
FixedVector< C, SIZE > & | operator*= (const C c) |
FixedVector< C, SIZE > & | operator/= (const C c) |
Protected Attributes | |
C * | values_ |
This class models finite, densely populated vectors x = (x_0, ... ,x_{n-1}) of a a-priori known size with entries from an arbitrary (scalar) class C, designed for numerical computations. The signature parallels that of Vector.
A FixedVector<C, SIZE> has essentially the same functionality as a FixedArray1D<C, SIZE>. However, we deliberately don't use inheritance here in order to really provide a raw class with maximum performance.
typedef const value_type* MathTL::FixedVector< C, SIZE >::const_iterator |
const iterator type (cf. STL containers)
typedef const value_type* MathTL::FixedVector< C, SIZE >::const_pointer |
const pointer type (cf. STL containers)
typedef const value_type& MathTL::FixedVector< C, SIZE >::const_reference |
const reference type (cf. STL containers)
typedef value_type* MathTL::FixedVector< C, SIZE >::iterator |
iterator type (cf. STL containers)
typedef value_type* MathTL::FixedVector< C, SIZE >::pointer |
pointer type (cf. STL containers)
typedef value_type& MathTL::FixedVector< C, SIZE >::reference |
reference type (cf. STL containers)
typedef unsigned int MathTL::FixedVector< C, SIZE >::size_type |
type of indexes and size type (cf. STL containers)
typedef C MathTL::FixedVector< C, SIZE >::value_type |
value type (cf. STL containers)
MathTL::FixedVector< C, SIZE >::FixedVector | ( | ) | [inline] |
default constructor all entries are initialized with their default constructor
MathTL::FixedVector< C, SIZE >::FixedVector | ( | const C | c | ) | [inline] |
construct a vector with all entries of the given number
MathTL::FixedVector< C, SIZE >::FixedVector | ( | const FixedVector< C, SIZE > & | v | ) | [inline] |
copy constructor
MathTL::FixedVector< C, SIZE >::~FixedVector | ( | ) | [inline, virtual] |
release allocated memory
void MathTL::FixedVector< C, SIZE >::add | ( | const FixedVector< C2, SIZE > & | v | ) |
in place summation *this += v
void MathTL::FixedVector< C, SIZE >::add | ( | const C2 | s, |
const FixedVector< C2, SIZE > & | v | ||
) |
in place summation *this += s*v
FixedVector< C, SIZE >::const_iterator MathTL::FixedVector< C, SIZE >::begin | ( | ) | const [inline] |
read-only iterator access to first element (cf. STL containers)
FixedVector< C, SIZE >::iterator MathTL::FixedVector< C, SIZE >::begin | ( | ) | [inline] |
read-write iterator access to first element (cf. STL containers)
FixedVector< C, SIZE >::const_iterator MathTL::FixedVector< C, SIZE >::end | ( | ) | const [inline] |
read-only iterator access to the element behind the last one (cf. STL containers)
FixedVector< C, SIZE >::iterator MathTL::FixedVector< C, SIZE >::end | ( | ) | [inline] |
read-only iterator access to the element behind the last one (cf. STL containers)
const C MathTL::FixedVector< C, SIZE >::inner_product | ( | const FixedVector< C2, SIZE > & | v | ) | const |
inner product
bool MathTL::FixedVector< C, SIZE >::operator!= | ( | const FixedVector< C2, SIZE > & | v | ) | const [inline] |
non-equality test
const C MathTL::FixedVector< C, SIZE >::operator() | ( | const size_type | i | ) | const [inline] |
Matlab style read-only access to the i-th vector component
C & MathTL::FixedVector< C, SIZE >::operator() | ( | const size_type | i | ) | [inline] |
Matlab style read-write access to the i-th vector component
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator*= | ( | const C | c | ) |
in place multiplication with a scalar
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator+= | ( | const FixedVector< C2, SIZE > & | v | ) | [inline] |
in place summation
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator-= | ( | const FixedVector< C2, SIZE > & | v | ) | [inline] |
in place subtraction
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator/= | ( | const C | c | ) |
in place division by a (nontrivial) scalar
bool MathTL::FixedVector< C, SIZE >::operator< | ( | const FixedVector< C2, SIZE > & | v | ) | const [inline] |
lexicographical order
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator= | ( | const FixedVector< C, SIZE > & | v | ) |
assignment from another fixed vector
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator= | ( | const C | c | ) | [inline] |
assignment of a constant value to each component
bool MathTL::FixedVector< C, SIZE >::operator== | ( | const FixedVector< C2, SIZE > & | v | ) | const |
equality test with another vector
const C MathTL::FixedVector< C, SIZE >::operator[] | ( | const size_type | i | ) | const [inline] |
C style read-only access to the i-th vector component
C & MathTL::FixedVector< C, SIZE >::operator[] | ( | const size_type | i | ) | [inline] |
C style read-write access to the i-th vector component
void MathTL::FixedVector< C, SIZE >::sadd | ( | const C | s, |
const FixedVector< C2, SIZE > & | v | ||
) |
in place summation *this = s*(*this) + v (AXPY level 1 BLAS routine)
void MathTL::FixedVector< C, SIZE >::scale | ( | const C | s | ) |
in place scaling *this *= s
size_type MathTL::FixedVector< C, SIZE >::size | ( | ) | const [inline] |
size/dimension of the vector
void MathTL::FixedVector< C, SIZE >::subtract | ( | const FixedVector< C2, SIZE > & | v | ) |
in place subtraction *this -= v
C* MathTL::FixedVector< C, SIZE >::values_ [protected] |
internal storage is just a pointer to a C array