SG++-Doxygen-Documentation
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 getLeftBoundaryPoint (size_t dim)
Sets the index to the grid point at the left boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type. 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 getParent (size_t dim)
Sets the index to the parent WARNING: this just works for grids without boundaries. More...

void getRightBoundaryPoint (size_t dim)
Sets the index to the grid point at the right boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type. 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 isHierarchicalAncestor (HashGridPoint &gpj)
checks if this is a hierarchical ancestor of gpj More...

bool isHierarchicalAncestor (HashGridPoint &gpj, size_t dim)
checks if this is a hierarchical ancestor of gpj in dimension dim 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 setAsHierarchicalGridPoint (size_t dim, level_type level, index_type index)
Sets the index to the grid point at the left boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type. 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.

## ◆ index_type

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

index type

## ◆ level_type

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

level type

## ◆ HashGridPoint() [1/4]

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

Constructor of a n-Dim gridpoint.

Parameters
 dimension the dimension of the gridpoint

## ◆ HashGridPoint() [2/4]

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

Standard-Constructor.

## ◆ HashGridPoint() [3/4]

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

Copy-Constructor.

Parameters
 o constant reference to HashGridPoint object

References rehash().

## ◆ HashGridPoint() [4/4]

 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().

## ◆ ~HashGridPoint()

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

Destructor.

## ◆ assign()

 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().

## ◆ equals()

 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

## ◆ getDimension()

 size_t sgpp::base::HashGridPoint::getDimension ( ) const

## ◆ getHash()

 size_t sgpp::base::HashGridPoint::getHash ( ) const

gets the hash value of the current instance

Returns
the hash value of the instance

## ◆ getLeftBoundaryPoint()

 void sgpp::base::HashGridPoint::getLeftBoundaryPoint ( size_t dim )
inline

Sets the index to the grid point at the left boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type.

Parameters
 dim the dimension in which the modification is taken place

References chess::dim.

## ◆ getLeftChild()

 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

References chess::dim, and python.statsfileInfo::i.

## ◆ getLeftLevelZero()

 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

References chess::dim.

## ◆ getLevelMax()

 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

## ◆ getLevelMin()

 HashGridPoint::level_type sgpp::base::HashGridPoint::getLevelMin ( ) const

Returns the minimum of the one-dimensional levels.

Returns
the minimum of the one-dimensional levels

## ◆ getLevelSum()

 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

## ◆ getParent()

 void sgpp::base::HashGridPoint::getParent ( size_t dim )
inline

Sets the index to the parent WARNING: this just works for grids without boundaries.

Parameters
 dim the dimension in which the modification is taken place

References chess::dim, and python.statsfileInfo::i.

Referenced by sgpp::base::HashGridStorage::insert().

## ◆ getRightBoundaryPoint()

 void sgpp::base::HashGridPoint::getRightBoundaryPoint ( size_t dim )
inline

Sets the index to the grid point at the right boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type.

Parameters
 dim the dimension in which the modification is taken place

References chess::dim.

## ◆ getRightChild()

 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

References chess::dim, and python.statsfileInfo::i.

## ◆ getRightLevelZero()

 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

References chess::dim.

## ◆ getRoot()

 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

## ◆ getStandardCoordinates()

 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().

## ◆ isHierarchicalAncestor() [1/2]

 bool sgpp::base::HashGridPoint::isHierarchicalAncestor ( HashGridPoint & gpj )

checks if this is a hierarchical ancestor of gpj

Parameters
 gpj
Returns

## ◆ isHierarchicalAncestor() [2/2]

 bool sgpp::base::HashGridPoint::isHierarchicalAncestor ( HashGridPoint & gpj, size_t dim )

checks if this is a hierarchical ancestor of gpj in dimension dim

Parameters
 gpj dim
Returns

References chess::dim, getIndex(), and getLevel().

## ◆ isInnerPoint()

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

Determines if the grid point is an inner grid point.

Inner points are exactly those points which are not on the boundary in any dimension.

Returns
true if the grid point is an inner grid point

## ◆ isLeaf()

 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

## ◆ operator=()

 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().

## ◆ push() [1/2]

 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

References python.statsfileInfo::i.

## ◆ push() [2/2]

 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 python.statsfileInfo::i, and isLeaf().

## ◆ rehash()

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

rehashs the current gridpoint and sets hInv

## ◆ serialize()

 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

## ◆ set() [2/2]

 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 python.statsfileInfo::i, isLeaf(), and rehash().

## ◆ setAsHierarchicalGridPoint()

 void sgpp::base::HashGridPoint::setAsHierarchicalGridPoint ( size_t dim, level_type level, index_type index )
inline

Sets the index to the grid point at the left boundary of the support For details see ´http://graphics.stanford.edu/~seander/bithacks.html´ and ´http://supertech.csail.mit.edu/papers/debruijn.pdf´ WARNING: this just works for grids with non-overlapping basis functions at the same level and for uint32_t as index_type.

Parameters
 dim the dimension in which the modification is taken place level level in direction dim index index in direction dim

References chess::dim, and isHierarchicalAncestor().

## ◆ setLeaf()

 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().

## ◆ toString() [1/2]

 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

## ◆ toString() [2/2]

 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

References python.statsfileInfo::i.

## ◆ HashGridPointEqualityFunctor

 friend struct HashGridPointEqualityFunctor
friend

## ◆ HashGridPointHashFunctor

 friend struct HashGridPointHashFunctor
friend

## ◆ HashGridPointPointerEqualityFunctor

 friend struct HashGridPointPointerEqualityFunctor
friend

## ◆ HashGridPointPointerHashFunctor

 friend struct HashGridPointPointerHashFunctor
friend

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