LoAdSG
AdaptiveSparseGrid Class Reference

#include <sparseGrid.h>

Inheritance diagram for AdaptiveSparseGrid:

Public Member Functions

 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)
 

Protected Member Functions

unsigned long getFreeSpaceNumberInSecondTable ()
 

Protected Attributes

unsigned long * secondTable
 

‍0 means empty; v>0 means v-1 is array index


 
bool * isActiveNodeTable
 

‍0 means empty; 1 means occupied, but no next; v>1 means v-2 is next array index


 
int * indicesSecondTable
 

‍true means AdaptiveSparseGrid_Base::getIndexOfTable (i) is active node.


 
int * indicesSupportMin
 

‍Contains coded indices. Length: secondTableLength*DimensionSparseGrid


 

Private Member Functions

void CompleteToLocalTensorProductGrid ()
 

‍adds all father points including boundary points


 

Detailed Description

adaptive sparse grid

                           |       |        |       |
                           |       |        |       | <--- minimalEmpty
                           | prime |        |second | 
(index,...) ------------>  | table | -----> |table  | <--|
            hashfunction   |       |        |       |    |
                           |       |        |       | ---|

Constructor & Destructor Documentation

◆ AdaptiveSparseGrid()

AdaptiveSparseGrid::AdaptiveSparseGrid ( )
inline
Parameters
estimatedMaxNumberOfDatageschaetzte maximale Anzahl von Speicher-Variablen

Member Function Documentation

◆ AddPoint()

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.

Here is the caller graph for this function:

◆ CompleteToLocalTensorProductGrid()

void AdaptiveSparseGrid::CompleteToLocalTensorProductGrid ( )
private

‍adds all father points including boundary points

Einfachere Methode als CompleteToLocalTensorProductGrid(). Überprüft Definition.

◆ getFreeSpaceNumberInSecondTable()

unsigned long AdaptiveSparseGrid_Base::getFreeSpaceNumberInSecondTable ( )
protectedinherited
Returns
index k such that secondTable[k] is empty
Here is the caller graph for this function:

◆ getIndexOfTable()

IndexDimension AdaptiveSparseGrid_Base::getIndexOfTable ( unsigned long  i)
inlineinherited
Parameters
ikodierung des Index als langer unsigned long
Returns
IndexDimension "=(i_1,...,i_d)"
Here is the caller graph for this function:

◆ hash()

unsigned long AdaptiveSparseGrid_Base::hash ( IndexDimension  index)
inlineinherited
Returns
unsigned key
Here is the caller graph for this function:

◆ occupied()

bool AdaptiveSparseGrid_Base::occupied ( unsigned long &  indexOfData,
IndexDimension  I 
)
inlineinherited

schaut nach ob Punkt im Gitter ist

Parameters
Iindex des Punktes
indexOfDatareturn: index der daten, falls Punkt im Gitter ist
Returns
true, false je nachdem ob Punkt im Gitter ist
Here is the caller graph for this function:

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