MathTL
 All Classes Functions Variables Typedefs Enumerations
Public Types | Public Member Functions | Protected Attributes
MathTL::FixedVector< C, SIZE > Class Template Reference

#include <fixed_vector.h>

List of all members.

Public Types

typedef C value_type
typedef value_typepointer
typedef const value_typeconst_pointer
typedef value_typeiterator
typedef const value_typeconst_iterator
typedef value_typereference
typedef const value_typeconst_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_

Detailed Description

template<class C, unsigned int SIZE>
class MathTL::FixedVector< C, SIZE >

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.


Member Typedef Documentation

template<class C, unsigned int SIZE>
typedef const value_type* MathTL::FixedVector< C, SIZE >::const_iterator

const iterator type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef const value_type* MathTL::FixedVector< C, SIZE >::const_pointer

const pointer type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef const value_type& MathTL::FixedVector< C, SIZE >::const_reference

const reference type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef value_type* MathTL::FixedVector< C, SIZE >::iterator

iterator type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef value_type* MathTL::FixedVector< C, SIZE >::pointer

pointer type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef value_type& MathTL::FixedVector< C, SIZE >::reference

reference type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef unsigned int MathTL::FixedVector< C, SIZE >::size_type

type of indexes and size type (cf. STL containers)

template<class C, unsigned int SIZE>
typedef C MathTL::FixedVector< C, SIZE >::value_type

value type (cf. STL containers)


Constructor & Destructor Documentation

template<class C , unsigned int SIZE>
MathTL::FixedVector< C, SIZE >::FixedVector ( ) [inline]

default constructor all entries are initialized with their default constructor

template<class C, unsigned int SIZE>
MathTL::FixedVector< C, SIZE >::FixedVector ( const C  c) [inline]

construct a vector with all entries of the given number

template<class C, unsigned int SIZE>
MathTL::FixedVector< C, SIZE >::FixedVector ( const FixedVector< C, SIZE > &  v) [inline]

copy constructor

template<class C , unsigned int SIZE>
MathTL::FixedVector< C, SIZE >::~FixedVector ( ) [inline, virtual]

release allocated memory


Member Function Documentation

template<class C , unsigned int SIZE>
template<class C2 >
void MathTL::FixedVector< C, SIZE >::add ( const FixedVector< C2, SIZE > &  v)

in place summation *this += v

template<class C , unsigned int SIZE>
template<class C2 >
void MathTL::FixedVector< C, SIZE >::add ( const C2  s,
const FixedVector< C2, SIZE > &  v 
)

in place summation *this += s*v

template<class C , unsigned int SIZE>
FixedVector< C, SIZE >::const_iterator MathTL::FixedVector< C, SIZE >::begin ( ) const [inline]

read-only iterator access to first element (cf. STL containers)

template<class C , unsigned int SIZE>
FixedVector< C, SIZE >::iterator MathTL::FixedVector< C, SIZE >::begin ( ) [inline]

read-write iterator access to first element (cf. STL containers)

template<class C , unsigned int SIZE>
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)

template<class C , unsigned int SIZE>
FixedVector< C, SIZE >::iterator MathTL::FixedVector< C, SIZE >::end ( ) [inline]

read-only iterator access to the element behind the last one (cf. STL containers)

template<class C, unsigned int SIZE>
template<class C2 >
const C MathTL::FixedVector< C, SIZE >::inner_product ( const FixedVector< C2, SIZE > &  v) const

inner product

template<class C , unsigned int SIZE>
template<class C2 >
bool MathTL::FixedVector< C, SIZE >::operator!= ( const FixedVector< C2, SIZE > &  v) const [inline]

non-equality test

template<class C , unsigned int SIZE>
const C MathTL::FixedVector< C, SIZE >::operator() ( const size_type  i) const [inline]

Matlab style read-only access to the i-th vector component

template<class C , unsigned int SIZE>
C & MathTL::FixedVector< C, SIZE >::operator() ( const size_type  i) [inline]

Matlab style read-write access to the i-th vector component

template<class C, unsigned int SIZE>
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator*= ( const C  c)

in place multiplication with a scalar

template<class C , unsigned int SIZE>
template<class C2 >
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator+= ( const FixedVector< C2, SIZE > &  v) [inline]

in place summation

template<class C , unsigned int SIZE>
template<class C2 >
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator-= ( const FixedVector< C2, SIZE > &  v) [inline]

in place subtraction

template<class C, unsigned int SIZE>
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator/= ( const C  c)

in place division by a (nontrivial) scalar

template<class C , unsigned int SIZE>
template<class C2 >
bool MathTL::FixedVector< C, SIZE >::operator< ( const FixedVector< C2, SIZE > &  v) const [inline]

lexicographical order

template<class C, unsigned int SIZE>
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator= ( const FixedVector< C, SIZE > &  v)

assignment from another fixed vector

template<class C, unsigned int SIZE>
FixedVector< C, SIZE > & MathTL::FixedVector< C, SIZE >::operator= ( const C  c) [inline]

assignment of a constant value to each component

template<class C , unsigned int SIZE>
template<class C2 >
bool MathTL::FixedVector< C, SIZE >::operator== ( const FixedVector< C2, SIZE > &  v) const

equality test with another vector

template<class C , unsigned int SIZE>
const C MathTL::FixedVector< C, SIZE >::operator[] ( const size_type  i) const [inline]

C style read-only access to the i-th vector component

template<class C , unsigned int SIZE>
C & MathTL::FixedVector< C, SIZE >::operator[] ( const size_type  i) [inline]

C style read-write access to the i-th vector component

template<class C, unsigned int SIZE>
template<class C2 >
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)

template<class C, unsigned int SIZE>
void MathTL::FixedVector< C, SIZE >::scale ( const C  s)

in place scaling *this *= s

template<class C, unsigned int SIZE>
size_type MathTL::FixedVector< C, SIZE >::size ( ) const [inline]

size/dimension of the vector

template<class C , unsigned int SIZE>
template<class C2 >
void MathTL::FixedVector< C, SIZE >::subtract ( const FixedVector< C2, SIZE > &  v)

in place subtraction *this -= v


Member Data Documentation

template<class C, unsigned int SIZE>
C* MathTL::FixedVector< C, SIZE >::values_ [protected]

internal storage is just a pointer to a C array


The documentation for this class was generated from the following files:
 All Classes Functions Variables Typedefs Enumerations