SG++-Doxygen-Documentation
python.toolsExtended Namespace Reference

Functions

def buildAlphaVector (filename)
 Wrapper for buildCoefficientVectorFromFile. More...
 
def buildCoefficientVectorFromFile (filename)
 Builds the data vector that hold the coefficients fo either the ansatzfuctions or the node base re.sub(regex, replacement, subject) More...
 
def buildNodevalueVector (filename)
 Wrapper for buildCoefficientVectorFromFile. More...
 
def buildTrainingVector (data)
 Builds the training data vector. More...
 
def compareBBTMatrices (m1, m2)
 Compares, if two BBT matrices are "almost" equal. More...
 
def compareBTMatrices (m1, m2)
 Compares, if two BT matrices are "almost" equal. More...
 
def compareResultFiles (file1, file2)
 Compares two files and calculates the maximum difference between the values. More...
 
def doDehierarchisation (alpha, grid)
 hierarchisation of the node base values on a grid More...
 
def doHierarchisation (node_values, grid)
 hierarchisation of the node base values on a grid More...
 
def evalFunction (function, points)
 evalutes a given function More...
 
def generateBBTMatrix (factory, training, verbose=False)
 Generates the BBT DM Matrix for a given grid using numpy. More...
 
def generateBBTMatrixPython (factory, training, verbose=False)
 Generates the BBT DM Matrix for a given grid only using python arrays. More...
 
def generateBTMatrix (factory, training, verbose=False)
 Generates the BT DM Matrix for a given grid using numpy. More...
 
def generateBTMatrixPython (factory, training, verbose=False)
 Generates the BT DM Matrix for a given grid only using python arrays. More...
 
def generateCMatrix (factory, verbose=False)
 Generates the Laplace Matrix for a given grid using numpy. More...
 
def openFile (filename)
 Opens a file and returns the stored data. More...
 
def printNDFunction (filename, filenameValue, grid, alpha, resolution)
 This allows to evaluate a multidimensional function. More...
 
def printPoint (p, grid, alpha, fout, foutvalue)
 Here a evaluate point on a Sparse Grid is written to a file. More...
 
def printRefNDFunction (filename, filenameValue, function, resolution, dim)
 This allows to evaluate a multidimensional function. More...
 
def printRefPoint (points, dim, function, fout, foutvalue)
 Writes reference points to a given file. More...
 
def readDataVector (filename)
 Reads a DataVector. More...
 
def readReferenceMatrix (storage, filename)
 Reads a Reference matrix and returns it. More...
 
def recGenPrintRefVector (dim_rem, dim, points, function, resolution, fout, foutvalue)
 Recursive generation of the function's coordinate string. More...
 
def recGenPrintVector (dim_rem, p, grid, alpha, resolution, fout, foutvalue)
 Evaluates a mutlidimensional function on a Sparse Grid. More...
 
def testHierarchisationResults (node1, node2)
 tests the correctness of the hierarchisation and dehierachisation More...
 
def writeMatrixToFile (filename, matrix, n, m)
 Writes matrix stored in numpy format into a file. More...
 

Function Documentation

◆ buildAlphaVector()

def python.toolsExtended.buildAlphaVector (   filename)

Wrapper for buildCoefficientVectorFromFile.

Parameters
filenamename of the ARFF file that contains the ansatzfunction coefficients
Returns
a instance of a DataVector that stores ansatzfunction coefficients

References python.toolsExtended.buildCoefficientVectorFromFile().

◆ buildCoefficientVectorFromFile()

def python.toolsExtended.buildCoefficientVectorFromFile (   filename)

Builds the data vector that hold the coefficients fo either the ansatzfuctions or the node base re.sub(regex, replacement, subject)

Parameters
filenamename of the ARFF file that contains the coefficients
Returns
a instance of a DataVector that stores coefficients

References python.tools.readDataARFF().

Referenced by python.toolsExtended.buildAlphaVector(), and python.toolsExtended.buildNodevalueVector().

◆ buildNodevalueVector()

def python.toolsExtended.buildNodevalueVector (   filename)

Wrapper for buildCoefficientVectorFromFile.

Parameters
filenamename of the ARFF file that contains the node base coefficients
Returns
a instance of a DataVector that stores node base coefficients

References python.toolsExtended.buildCoefficientVectorFromFile().

◆ buildTrainingVector()

def python.toolsExtended.buildTrainingVector (   data)

Builds the training data vector.

Parameters
dataa list of lists that contains the points a the training data set, coordinate-wise
Returns
a instance of a DataVector that stores the training data

◆ compareBBTMatrices()

def python.toolsExtended.compareBBTMatrices (   m1,
  m2 
)

Compares, if two BBT matrices are "almost" equal.

Has to handle the problem that the underlying grid was ordered differently. Uses heuristics, e.g. whether the diagonal elements and row and column sums match. and prints the result for each element

Parameters
m1the first matrix
m2the second matrix

◆ compareBTMatrices()

def python.toolsExtended.compareBTMatrices (   m1,
  m2 
)

Compares, if two BT matrices are "almost" equal.

Has to handle the problem that the underlying grid was ordered differently. Uses heuristics, e.g. whether the row and column sums match. and prints the result for each element

Parameters
m1the first matrix
m2the second matrix

◆ compareResultFiles()

def python.toolsExtended.compareResultFiles (   file1,
  file2 
)

◆ doDehierarchisation()

◆ doHierarchisation()

◆ evalFunction()

◆ generateBBTMatrix()

def python.toolsExtended.generateBBTMatrix (   factory,
  training,
  verbose = False 
)

Generates the BBT DM Matrix for a given grid using numpy.

Parameters
factorythe grid object
trainingDataVector to contains the used training data
verbosedefault:False prints some additional information

Referenced by python.testcondition.calc_condition().

◆ generateBBTMatrixPython()

def python.toolsExtended.generateBBTMatrixPython (   factory,
  training,
  verbose = False 
)

Generates the BBT DM Matrix for a given grid only using python arrays.

Parameters
factorythe grid object
trainingDataVector to contains the used training data
verbosedefault:False prints some additional information

◆ generateBTMatrix()

def python.toolsExtended.generateBTMatrix (   factory,
  training,
  verbose = False 
)

Generates the BT DM Matrix for a given grid using numpy.

Parameters
factorythe grid object
trainingDataVector to contains the used training data
verbosedefault:False prints some additional information

◆ generateBTMatrixPython()

def python.toolsExtended.generateBTMatrixPython (   factory,
  training,
  verbose = False 
)

Generates the BT DM Matrix for a given grid only using python arrays.

Parameters
factorythe grid object
trainingDataVector to contains the used training data
verbosedefault:False prints some additional information

◆ generateCMatrix()

def python.toolsExtended.generateCMatrix (   factory,
  verbose = False 
)

Generates the Laplace Matrix for a given grid using numpy.

Parameters
factorythe grid object
verbosedefault:False prints some additional information

References sgpp::op_factory.createOperationLaplace().

Referenced by python.testcondition.calc_condition().

◆ openFile()

def python.toolsExtended.openFile (   filename)

Opens a file and returns the stored data.

Parameters
filenameof file to open
Returns
the data stored in the file

References python.tools.readDataARFF().

◆ printNDFunction()

def python.toolsExtended.printNDFunction (   filename,
  filenameValue,
  grid,
  alpha,
  resolution 
)

This allows to evaluate a multidimensional function.

Parameters
filenamefilename of file with coordinates and function values
filenameValuefilename of file with function values only
gridreference to the Sparse Grid
alphahierarchical surplus of the Sparse Grid's Ansatzfunctions
resolutionnumber of evaluating points

References analyse_erg.file, and python.toolsExtended.recGenPrintVector().

Referenced by python.hierarchisation.runHierarchisationDehierarchisationLinearBoundaryRegularTestPrintND(), python.hierarchisation.runHierarchisationDehierarchisationLinearRegularTestPrintND(), python.hierarchisation.runHierarchisationDehierarchisationLinearTruncatedBoundaryRegularTestPrintND(), and python.hierarchisation.runHierarchisationDehierarchisationModLinearTestPrintND().

◆ printPoint()

def python.toolsExtended.printPoint (   p,
  grid,
  alpha,
  fout,
  foutvalue 
)

Here a evaluate point on a Sparse Grid is written to a file.

Parameters
pDataVector containing the coordinates of the point
gridreference to the Sparse Grid
alphahierarchical surplus of the Sparse Grid's Ansatzfunctions
foutfilehandle to result file, containing the coordinates and value
foutvaluefilehandle to resultfile, containing only the value

References sgpp::op_factory.createOperationEval().

Referenced by python.toolsExtended.recGenPrintVector().

◆ printRefNDFunction()

def python.toolsExtended.printRefNDFunction (   filename,
  filenameValue,
  function,
  resolution,
  dim 
)

This allows to evaluate a multidimensional function.

Parameters
filenamefilename of file with coordinates and function values
filenameValuefilename of file with function values only
functionstring that describes the function to evaluate
resolutionnumber of evaluating points
dimdimension of function

References analyse_erg.file, and python.toolsExtended.recGenPrintRefVector().

Referenced by python.hierarchisation.runHierarchisationDehierarchisationLinearBoundaryRegularTestPrintND(), python.hierarchisation.runHierarchisationDehierarchisationLinearRegularTestPrintND(), python.hierarchisation.runHierarchisationDehierarchisationLinearTruncatedBoundaryRegularTestPrintND(), and python.hierarchisation.runHierarchisationDehierarchisationModLinearTestPrintND().

◆ printRefPoint()

def python.toolsExtended.printRefPoint (   points,
  dim,
  function,
  fout,
  foutvalue 
)

Writes reference points to a given file.

Parameters
pointsstring containing the evaluation potins
dimthe dimension of the function
functionstring that describes the function to evaluate
foutfilehandle to result file, containing the coordinates and value
foutvaluefilehandle to resultfile, containing only the value

References python.toolsExtended.evalFunction().

Referenced by python.toolsExtended.recGenPrintRefVector().

◆ readDataVector()

def python.toolsExtended.readDataVector (   filename)

Reads a DataVector.

Parameters
filenamethe filename of the file that contains the data
Returns
returns a data Vector

◆ readReferenceMatrix()

def python.toolsExtended.readReferenceMatrix (   storage,
  filename 
)

Reads a Reference matrix and returns it.

Parameters
storagestorage of the grid
filenamethe filename of the file that contains the reference data
Returns
returns a python array with the reference matrix

References python.tools.gzOpen(), and sgpp::combigrid.split().

◆ recGenPrintRefVector()

def python.toolsExtended.recGenPrintRefVector (   dim_rem,
  dim,
  points,
  function,
  resolution,
  fout,
  foutvalue 
)

Recursive generation of the function's coordinate string.

Parameters
dim_remremaining dimensions
dimdimension of function
pointscurrent coordinate string
functionstring that describes the function to evaluate
resolutionnumber of supporting points
foutfilehandle to result file, containing the coordinates and value
foutvaluefilehandle to resultfile, containing only the value

References python.toolsExtended.printRefPoint().

Referenced by python.toolsExtended.printRefNDFunction().

◆ recGenPrintVector()

def python.toolsExtended.recGenPrintVector (   dim_rem,
  p,
  grid,
  alpha,
  resolution,
  fout,
  foutvalue 
)

Evaluates a mutlidimensional function on a Sparse Grid.

Parameters
dim_remremaining dimensions
pDataVector containing the coordinates of the point
gridreference to the Sparse Grid
alphahierarchical surplus of the Sparse Grid's Ansatzfunctions
resolutionnumber of evaluating points
foutfilehandle to result file, containing the coordinates and value
foutvaluefilehandle to resultfile, containing only the value

References python.toolsExtended.printPoint().

Referenced by python.toolsExtended.printNDFunction().

◆ testHierarchisationResults()

◆ writeMatrixToFile()

def python.toolsExtended.writeMatrixToFile (   filename,
  matrix,
  n,
  m 
)

Writes matrix stored in numpy format into a file.

Parameters
filenamefile's filename to which the data is written
matrixthe matrix that should be stored
nnumber of rows
mnumber of columns

References analyse_erg.file.