|
| AdaptiveSparseGrid () |
|
bool | AddPoint (const IndexDimension I) |
|
void | printCoordinates () |
| Prints coordinates of adaptive sparse grid.
|
|
void | Print_gnu (string name) |
| Prints coordinates of adaptive sparse grid in gnu-file.
|
|
void | PrintActiveHanging (int level) |
| prints active nodes (o) and hanging nodes (x)
|
|
void | PrintGridIndices (int level, IndexDimension *Indices, int numberofindices) |
| prints all nodes and highlights given Indices
|
|
bool | occupied (unsigned long &indexOfData, IndexDimension I) |
|
IndexDimension | getIndexOfTable (unsigned long i) |
|
unsigned long | hash (IndexDimension index) |
|
adaptive sparse grid
| | | |
| | | | <--- minimalEmpty
| prime | |second |
(index,...) ------------> | table | -----> |table | <--|
hashfunction | | | | |
| | | | ---|
bool AdaptiveSparseGrid::AddPoint |
( |
const IndexDimension |
I | ) |
|
|
virtual |
- 1.)key=Hashfunction(I);
- 2.)ind = primeTable[key];
First Case: ind == 0 (that means primeTable[key] is free)
secondTable primeTable Indices-
secondTable
__ ___ ______
search free | | store f+1 | | | |
space f ------> |f | (to make sure, | | | |
| | that primeTable[key] -----> |f+1| store indices ---> |f |
| | isnt zero by accident) | | (i_1,..,i_d) |f+1 |
| | |___| |... |
| | |f+d-1 |
| | |______|
|__|
Second Case: ind=primeTable[key]!=0 (this key was already used)!
- Check if getIndexOfTable(ind-1)=I (remember that data was stored with shift)
- else: Search in secondTable:
secondTable
___
| |
| |
|f | <--- in secondTable[f] store 1 <----
| | |
| | |
| | |
| |
|ind| ---> 1 is stored because indicesSecondTable[ind] is already used;
|__ | so now search for new freespace f, delete 1 and store f+2
instead (and store indices (i_1,...,i_d) in indicesSecondTable)
Reimplemented from AdaptiveSparseGrid_Base.