GridVec< T > Class Template Reference

A class template for handling systems of MultiVector<T> objects. More...

#include <GridVec.hpp>

Collaboration diagram for GridVec< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

int NOfVectors () const
 Number of the grid functions in the object.
void Reset (int n_of_vectors=0)
 Memory management.
void Reset (const Array< Array< int > > &sizes)
 Memory management.
void SameSize (const GridVec &src)
 Sets the sizes as for a given system of vectors.
void Reset (const Array< int > &size)
 A system of one vector.
MultiVector< T > & operator[] (int i)
 Access to the multi-vectors.
GridVec< T > & operator= (const GridVec< T > &src)
 The normal assignment.
void SetZero ()
 Sets all the grid functions to zero.
GridVec< T > & operator *= (T a)
 Multiplies 'this' by a scalar.
GridVec< T > & operator+= (GridVec< T > &y)
 Adds a given vector to 'this' one.
GridVec< T > & operator-= (GridVec< T > &y)
 Subtracts from 'this'.
GridVec< T > & AddScaled (T a, GridVec< T > &y)
 Adds a vector y scaled by a factor a.
GridVec< T > & AddScaled (Array< T > &a, GridVec< T > &y)
 Adds a vector y scaled by factors a.
GridVec< T > & LinComb (T a, GridVec< T > &x, T b, GridVec< T > &y)
 Sets 'this' to $a x + b y$.
GridVec< T > & LinComb (Array< T > &a, GridVec< T > &x, Array< T > &b, GridVec< T > &y)
 Sets 'this' to $a x + b y$.
GridVec< T > & LinComb (GridVec< T > &x, T b, GridVec< T > &y)
 Sets 'this' to $a x + b y$ (i.e. a = 1).
GridVec< T > & LinComb (GridVec< T > &x, Array< T > &b, GridVec< T > &y)
 Sets 'this' to $x + b y$.
operator & (GridVec< T > &y)
 The Eucleadean scalar product.
double norm_2 ()
 The Eucleadean norm.
 GridVec ()
 creates a dummy object.
 GridVec (Array< Array< int > > &sizes)
 Allocates the memory.
 GridVec (Array< int > &size)
 A system of one vector.
 GridVec (GridVec< T > &src)
 Duplication.

Detailed Description

template<typename T>
class GridVec< T >

A class template for handling systems of MultiVector<T> objects.

This class is an array of MultiVector<T>-objects that should represent grid functions on different grids. For example, in the staggered-grid approximations, there are grid functions associated with different sides of the grid elements. The ranges of the grid functions are cartesian products of different sizes. These grid functions can be comprised in one GridVec<T> object.

As well as MultiVector<T>, GridVec<T> includes the arithmetic operations that induce the structure of the vector field on the set of all GridVec<T> objects of the same type.

The template depends on a type T. This type should satisfy the conditions listed in small_matrix.hpp for small matrices.


Constructor & Destructor Documentation

template<typename T>
GridVec< T >::GridVec (  )  [inline]

creates a dummy object.

template<typename T>
GridVec< T >::GridVec ( Array< Array< int > > &  sizes  )  [inline]

Allocates the memory.

Parameters:
[in] sizes The sizes.

template<typename T>
GridVec< T >::GridVec ( Array< int > &  size  )  [inline]

A system of one vector.

Parameters:
[in] size The sizes of the grid

template<typename T>
GridVec< T >::GridVec ( GridVec< T > &  src  )  [inline]

Duplication.


Member Function Documentation

template<typename T>
int GridVec< T >::NOfVectors (  )  const [inline]

Number of the grid functions in the object.

template<typename T>
void GridVec< T >::Reset ( int  n_of_vectors = 0  )  [inline]

Memory management.

Parameters:
[in] n_of_vectors Number of MultiVectors in the GridVector.

template<typename T>
void GridVec< T >::Reset ( const Array< Array< int > > &  sizes  )  [inline]

Memory management.

Parameters:
[in] sizes The sizes to set.

template<typename T>
void GridVec< T >::SameSize ( const GridVec< T > &  src  )  [inline]

Sets the sizes as for a given system of vectors.

Parameters:
[in] src The given system of vectors.

template<typename T>
void GridVec< T >::Reset ( const Array< int > &  size  )  [inline]

A system of one vector.

Parameters:
[in] size The sizes to set.

template<typename T>
MultiVector<T>& GridVec< T >::operator[] ( int  i  )  [inline]

Access to the multi-vectors.

Parameters:
[in] i The index of the multi-vector (from 0).

template<typename T>
GridVec<T>& GridVec< T >::operator= ( const GridVec< T > &  src  )  [inline]

The normal assignment.

template<typename T>
void GridVec< T >::SetZero (  )  [inline]

Sets all the grid functions to zero.

template<typename T>
GridVec<T>& GridVec< T >::operator *= ( a  )  [inline]

Multiplies 'this' by a scalar.

Parameters:
[in] a The scalar.

template<typename T>
GridVec< T > & GridVec< T >::operator+= ( GridVec< T > &  y  )  [inline]

Adds a given vector to 'this' one.

template<typename T>
GridVec< T > & GridVec< T >::operator-= ( GridVec< T > &  y  )  [inline]

Subtracts from 'this'.

template<typename T>
GridVec< T > & GridVec< T >::AddScaled ( a,
GridVec< T > &  y 
) [inline]

Adds a vector y scaled by a factor a.

Parameters:
[in] a Factor for scaling.
[in] y Vector to scale-add.

template<typename T>
GridVec< T > & GridVec< T >::AddScaled ( Array< T > &  a,
GridVec< T > &  y 
) [inline]

Adds a vector y scaled by factors a.

Parameters:
[in] a Factors for scaling.
[in] y Vector to scale-add.

template<typename T>
GridVec< T > & GridVec< T >::LinComb ( a,
GridVec< T > &  x,
b,
GridVec< T > &  y 
) [inline]

Sets 'this' to $a x + b y$.

template<typename T>
GridVec< T > & GridVec< T >::LinComb ( Array< T > &  a,
GridVec< T > &  x,
Array< T > &  b,
GridVec< T > &  y 
) [inline]

Sets 'this' to $a x + b y$.

template<typename T>
GridVec< T > & GridVec< T >::LinComb ( GridVec< T > &  x,
b,
GridVec< T > &  y 
) [inline]

Sets 'this' to $a x + b y$ (i.e. a = 1).

template<typename T>
GridVec< T > & GridVec< T >::LinComb ( GridVec< T > &  x,
Array< T > &  b,
GridVec< T > &  y 
) [inline]

Sets 'this' to $x + b y$.

template<typename T>
T GridVec< T >::operator & ( GridVec< T > &  y  )  [inline]

The Eucleadean scalar product.

template<typename T>
double GridVec< T >::norm_2 (  )  [inline]

The Eucleadean norm.


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 12:34:12 2007 for SG2 by  doxygen 1.5.2