SG++
sgpp::base::HashGridPoint Class Reference

This Class represents one Gridpoint. More...

#include <HashGridPoint.hpp>

## Public Types

typedef uint32_t index_type
index type More...

typedef uint32_t level_type
level type More...

## Public Member Functions

HashGridPointassign (const HashGridPoint &rhs)
A wrapper for operator=. More...

bool equals (const HashGridPoint &rhs) const
checks whether this gridpoints is identical to another one More...

void get (size_t d, level_type &l, index_type &i) const
gets level l and index i in dimension d by reference parameters More...

size_t getDimension () const
Gets the dimension of the gridpoint. More...

size_t getHash () const
gets the hash value of the current instance More...

index_type getIndex (size_t d) const
gets index i in dimension d More...

void getLeftChild (size_t dim)
Sets the index to the left child. More...

void getLeftLevelZero (size_t dim)
Sets the index to the left level zero parent. More...

level_type getLevel (size_t d) const
gets level l in dimension d More...

level_type getLevelMax () const
Returns the maximum of the one-dimensional levels, i.e., $$|\vec{l}|_\infty$$. More...

level_type getLevelMin () const
Returns the minimum of the one-dimensional levels. More...

level_type getLevelSum () const
Returns the sum of the one-dimensional levels, i.e., $$|\vec{l}|_1$$. More...

void getRightChild (size_t dim)
Sets the index to the right child. More...

void getRightLevelZero (size_t dim)
Sets the index to the right level zero parent. More...

void getRoot (size_t d)
Resets the index to the top level in direction d. More...

double getStandardCoordinate (size_t d) const
determines the coordinate in a given dimension "Standard" means no bounding box (i.e., the domain is the unit hypercube) and no stretching (i.e., the points have the standard locations $$i \cdot 2^{-\ell}$$). More...

void getStandardCoordinates (DataVector &coordinates) const
Sets the entries of DataVector p to the coordinates of the gridpoint "Standard" means no bounding box (i.e., the domain is the unit hypercube) and no stretching (i.e., the points have the standard locations $$i \cdot 2^{-\ell}$$). More...

HashGridPoint (size_t dimension)
Constructor of a n-Dim gridpoint. More...

HashGridPoint ()
Standard-Constructor. More...

HashGridPoint (const HashGridPoint &o)
Copy-Constructor. More...

HashGridPoint (std::istream &istream, int version)
Serialisation-Constructor. More...

bool isInnerPoint () const
determines if the grid point is an inner grid point More...

bool isLeaf ()
Checks if this grid point has not a single child in any dimension. More...

HashGridPointoperator= (const HashGridPoint &rhs)
operator to assign the current grid point with the values of another one More...

void push (size_t d, level_type l, index_type i)
Sets level l and index i in dimension d and doesn't rehash the HashGridPoint object. More...

void push (size_t d, level_type l, index_type i, bool isLeaf)
Sets level l and index i in dimension d and the Leaf property and doesn't rehash the HashGridPoint object. More...

void rehash ()
rehashs the current gridpoint and sets hInv More...

void serialize (std::ostream &ostream, int version)
Serialize this Gridpoint e.g. More...

void set (size_t d, level_type l, index_type i)
Sets level l and index i in dimension d and rehashs the HashGridPoint object. More...

void set (size_t d, level_type l, index_type i, bool isLeaf)
Sets level l and index i in dimension d and the Leaf property and rehashs the HashGridPoint object. More...

void setLeaf (bool isLeaf)
Set the leaf property; a grid point is called a leaf, if it has not a single child. More...

std::string toString () const
Generates a string with level and index of the gridpoint. More...

void toString (std::ostream &stream) const
Generates a string with level and index of the gridpoint. More...

~HashGridPoint ()
Destructor. More...

## Friends

struct HashGridPointEqualityFunctor

struct HashGridPointHashFunctor

struct HashGridPointPointerEqualityFunctor

struct HashGridPointPointerHashFunctor

## Detailed Description

This Class represents one Gridpoint.

A Gridpoint is given by its ansatzfunctions that are not zero in every dimension. Instances of this class are members in the hashmap that represents the whole grid.

## Member Typedef Documentation

 typedef uint32_t sgpp::base::HashGridPoint::index_type

index type

 typedef uint32_t sgpp::base::HashGridPoint::level_type

level type

## Constructor & Destructor Documentation

 sgpp::base::HashGridPoint::HashGridPoint ( size_t dimension )
explicit

Constructor of a n-Dim gridpoint.

Parameters
 dimension the dimension of the gridpoint
 sgpp::base::HashGridPoint::HashGridPoint ( )

Standard-Constructor.

 sgpp::base::HashGridPoint::HashGridPoint ( const HashGridPoint & o )

Copy-Constructor.

Parameters
 o constant reference to HashGridPoint object

References rehash().

 sgpp::base::HashGridPoint::HashGridPoint ( std::istream & istream, int version )

Serialisation-Constructor.

Parameters
 istream instream object the contains the information about the gridpoint version the serialization version of the file

References rehash().

 sgpp::base::HashGridPoint::~HashGridPoint ( )

Destructor.

## Member Function Documentation

 HashGridPoint & sgpp::base::HashGridPoint::assign ( const HashGridPoint & rhs )

A wrapper for operator=.

Parameters
 rhs a reference to a HashGridPoint that contains the values that should be copied
Returns
returns a reference HashGridPoint

References operator=().

Referenced by getStandardCoordinate().

 bool sgpp::base::HashGridPoint::equals ( const HashGridPoint & rhs ) const

checks whether this gridpoints is identical to another one

Running under WINDOW this is defined the way around, MSDN 2009: A binary predicate f(x,y) is a function object that has two argument objects x and y and a return value of true or false. An ordering imposed on a hash_map is a strict weak ordering if the binary predicate is irreflexive, antisymmetric, and transitive and if equivalence is transitive, where two objects x and y are defined to be equivalent when both f(x,y) and f(y,x) are false -> equalsSGLRBHash

Parameters
 rhs reference the another HashGridPoint instance
Returns
true if the gridpoints are identical otherwise false
 size_t sgpp::base::HashGridPoint::getDimension ( ) const

Gets the dimension of the gridpoint.

Returns
the dimension of the gridpoint
 size_t sgpp::base::HashGridPoint::getHash ( ) const

gets the hash value of the current instance

Returns
the hash value of the instance
 void sgpp::base::HashGridPoint::getLeftChild ( size_t dim )
inline

Sets the index to the left child.

Parameters
 dim the dimension in which the modification is taken place
 void sgpp::base::HashGridPoint::getLeftLevelZero ( size_t dim )
inline

Sets the index to the left level zero parent.

Parameters
 dim the dimension in which the modification is taken place
 HashGridPoint::level_type sgpp::base::HashGridPoint::getLevelMax ( ) const

Returns the maximum of the one-dimensional levels, i.e., $$|\vec{l}|_\infty$$.

Returns
the maximum of the one-dimensional levels
 HashGridPoint::level_type sgpp::base::HashGridPoint::getLevelMin ( ) const

Returns the minimum of the one-dimensional levels.

Returns
the minimum of the one-dimensional levels
 HashGridPoint::level_type sgpp::base::HashGridPoint::getLevelSum ( ) const

Returns the sum of the one-dimensional levels, i.e., $$|\vec{l}|_1$$.

Returns
the sum of the one-dimensional levels
 void sgpp::base::HashGridPoint::getRightChild ( size_t dim )
inline

Sets the index to the right child.

Parameters
 dim the dimension in which the modification is taken place
 void sgpp::base::HashGridPoint::getRightLevelZero ( size_t dim )
inline

Sets the index to the right level zero parent.

Parameters
 dim the dimension in which the modification is taken place
 void sgpp::base::HashGridPoint::getRoot ( size_t d )
inline

Resets the index to the top level in direction d.

Parameters
 d the dimension in which the modification is taken place
 double sgpp::base::HashGridPoint::getStandardCoordinate ( size_t d ) const
inline

determines the coordinate in a given dimension "Standard" means no bounding box (i.e., the domain is the unit hypercube) and no stretching (i.e., the points have the standard locations $$i \cdot 2^{-\ell}$$).

Parameters
 d the dimension in which the coordinate should be calculated
Returns
the coordinate in the given dimension
 void sgpp::base::HashGridPoint::getStandardCoordinates ( DataVector & coordinates ) const

Sets the entries of DataVector p to the coordinates of the gridpoint "Standard" means no bounding box (i.e., the domain is the unit hypercube) and no stretching (i.e., the points have the standard locations $$i \cdot 2^{-\ell}$$).

Parameters
 coordinates the DataVector that should be overwritten with the coordinates

References getStandardCoordinate(), and sgpp::base::DataVector::set().

 bool sgpp::base::HashGridPoint::isInnerPoint ( ) const

determines if the grid point is an inner grid point

Returns
true if the grid point is an inner grid point
 bool sgpp::base::HashGridPoint::isLeaf ( )

Checks if this grid point has not a single child in any dimension.

Returns
Returns true if this grid point has no children, otherwise false
 HashGridPoint & sgpp::base::HashGridPoint::operator= ( const HashGridPoint & rhs )

operator to assign the current grid point with the values of another one

Parameters
 rhs a reference to a HashGridPoint that contains the values that should be copied
Returns
returns a reference HashGridPoint

References rehash().

Referenced by assign(), and getStandardCoordinate().

 void sgpp::base::HashGridPoint::push ( size_t d, level_type l, index_type i )
inline

Sets level l and index i in dimension d and doesn't rehash the HashGridPoint object.

Parameters
 d the dimension in which the ansatzfunction is set l the level of the ansatzfunction i the index of the ansatzfunction
 void sgpp::base::HashGridPoint::push ( size_t d, level_type l, index_type i, bool isLeaf )
inline

Sets level l and index i in dimension d and the Leaf property and doesn't rehash the HashGridPoint object.

Parameters
 d the dimension in which the ansatzfunction is set l the level of the ansatzfunction i the index of the ansatzfunction isLeaf specifies if this gridpoint has any childrens in any dimension

References isLeaf().

 void sgpp::base::HashGridPoint::rehash ( )

rehashs the current gridpoint and sets hInv

 void sgpp::base::HashGridPoint::serialize ( std::ostream & ostream, int version )

Serialize this Gridpoint e.g.

for a storage or checkpointing

Parameters
 ostream outstream object to which the gridpoint's information is written version the serialization version of the file
 void sgpp::base::HashGridPoint::set ( size_t d, level_type l, index_type i, bool isLeaf )
inline

Sets level l and index i in dimension d and the Leaf property and rehashs the HashGridPoint object.

Parameters
 d the dimension in which the ansatzfunction is set l the level of the ansatzfunction i the index of the ansatzfunction isLeaf specifies if this gridpoint has any childrens in any dimension

References isLeaf(), and rehash().

 void sgpp::base::HashGridPoint::setLeaf ( bool isLeaf )

Set the leaf property; a grid point is called a leaf, if it has not a single child.

Parameters
 isLeaf specifies if the current index is a leaf (i.e. has no child nodes) or not

References isLeaf().

 std::string sgpp::base::HashGridPoint::toString ( ) const

Generates a string with level and index of the gridpoint.

The format is [l1, i1, l2, i2, ..., ld, id]. Needed for Java compatibility.

Returns
string into which the gridpoint is written
 void sgpp::base::HashGridPoint::toString ( std::ostream & stream ) const

Generates a string with level and index of the gridpoint.

The format is [l1, i1, l2, i2, ..., ld, id].

Parameters
 stream reference to a output stream

## Friends And Related Function Documentation

 friend struct HashGridPointEqualityFunctor
friend
 friend struct HashGridPointHashFunctor
friend
 friend struct HashGridPointPointerEqualityFunctor
friend
 friend struct HashGridPointPointerHashFunctor
friend

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