ug4
Vector< TValueType > Class Template Reference

#include <vector_interface.h>

Public Types

typedef size_t size_type
 
typedef TValueType value_type
 
typedef Vector< TValueType > vector_type
 

Public Member Functions

template<typename V >
bool add (const V &u)
 
void defragment ()
 
double dotprod (const Vector &w)
 returns v.T w, that is the dotprod of this vector and w More...
 
template<typename V >
bool get (V &u) const
 
double norm () const
 return sqrt(sum values[i]^2) (euclidian norm) More...
 
bool operator*= (const number &a)
 
void operator+= (const Vector &v)
 
void operator-= (const Vector &v)
 
void operator= (const Vector &v)
 assign other vector v More...
 
double operator= (double d)
 assign double d to whole Vector More...
 
value_typeoperator[] (size_t i)
 access element i of the vector More...
 
const value_typeoperator[] (size_t i) const
 
bool resize (size_t new_length, bool bCopyValues=true)
 resize vector More...
 
template<typename V >
bool set (const V &u)
 
bool set (double d)
 assign double d to whole Vector More...
 
bool set_random (double from, double to)
 
size_t size ()
 
 Vector ()
 constructor More...
 
 Vector (const vector_type &v)
 
 Vector (size_t _length)
 constructor with length More...
 
 ~Vector ()
 destructor More...
 

Member Typedef Documentation

◆ size_type

template<typename TValueType >
typedef size_t Vector< TValueType >::size_type

◆ value_type

template<typename TValueType >
typedef TValueType Vector< TValueType >::value_type

◆ vector_type

template<typename TValueType >
typedef Vector<TValueType> Vector< TValueType >::vector_type

Constructor & Destructor Documentation

◆ Vector() [1/3]

template<typename TValueType >
Vector< TValueType >::Vector ( )

constructor

◆ Vector() [2/3]

template<typename TValueType >
Vector< TValueType >::Vector ( size_t  _length)

constructor with length

◆ ~Vector()

template<typename TValueType >
Vector< TValueType >::~Vector ( )

destructor

◆ Vector() [3/3]

template<typename TValueType >
Vector< TValueType >::Vector ( const vector_type v)

Member Function Documentation

◆ add()

template<typename TValueType >
template<typename V >
bool Vector< TValueType >::add ( const V &  u)

add/set/get a local vector

The local vector type must provide the following members:

  • size() - length of local vector
  • index(size_t i) - global index for component i
  • operator[](size_t i) - access to value of component i

◆ defragment()

template<typename TValueType >
void Vector< TValueType >::defragment ( )

◆ dotprod()

template<typename TValueType >
double Vector< TValueType >::dotprod ( const Vector< TValueType > &  w)

returns v.T w, that is the dotprod of this vector and w

◆ get()

template<typename TValueType >
template<typename V >
bool Vector< TValueType >::get ( V &  u) const

◆ norm()

template<typename TValueType >
double Vector< TValueType >::norm ( ) const
inline

return sqrt(sum values[i]^2) (euclidian norm)

◆ operator*=()

template<typename TValueType >
bool Vector< TValueType >::operator*= ( const number a)

◆ operator+=()

template<typename TValueType >
void Vector< TValueType >::operator+= ( const Vector< TValueType > &  v)

◆ operator-=()

template<typename TValueType >
void Vector< TValueType >::operator-= ( const Vector< TValueType > &  v)

◆ operator=() [1/2]

template<typename TValueType >
void Vector< TValueType >::operator= ( const Vector< TValueType > &  v)

assign other vector v

◆ operator=() [2/2]

template<typename TValueType >
double Vector< TValueType >::operator= ( double  d)

assign double d to whole Vector

◆ operator[]() [1/2]

template<typename TValueType >
value_type& Vector< TValueType >::operator[] ( size_t  i)
inline

access element i of the vector

◆ operator[]() [2/2]

template<typename TValueType >
const value_type& Vector< TValueType >::operator[] ( size_t  i) const
inline

◆ resize()

template<typename TValueType >
bool Vector< TValueType >::resize ( size_t  new_length,
bool  bCopyValues = true 
)

resize vector

Referenced by CloneVector().

◆ set() [1/2]

template<typename TValueType >
template<typename V >
bool Vector< TValueType >::set ( const V &  u)

◆ set() [2/2]

template<typename TValueType >
bool Vector< TValueType >::set ( double  d)

assign double d to whole Vector

◆ set_random()

template<typename TValueType >
bool Vector< TValueType >::set_random ( double  from,
double  to 
)

◆ size()

template<typename TValueType >
size_t Vector< TValueType >::size ( )

The documentation for this class was generated from the following file: