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

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

 def python.toolsExtended.buildAlphaVector ( filename )

Wrapper for buildCoefficientVectorFromFile.

Parameters
 filename name of the ARFF file that contains the ansatzfunction coefficients
Returns
a instance of a DataVector that stores ansatzfunction coefficients
 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
 filename name of the ARFF file that contains the coefficients
Returns
a instance of a DataVector that stores coefficients

 def python.toolsExtended.buildNodevalueVector ( filename )

Wrapper for buildCoefficientVectorFromFile.

Parameters
 filename name of the ARFF file that contains the node base coefficients
Returns
a instance of a DataVector that stores node base coefficients
 def python.toolsExtended.buildTrainingVector ( data )

Builds the training data vector.

Parameters
 data a 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
 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
 m1 the first matrix m2 the second matrix
 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
 m1 the first matrix m2 the second matrix
 def python.toolsExtended.compareResultFiles ( file1, file2 )

Compares two files and calculates the maximum difference between the values.

Parameters
 file1 the first file file2 the second file
Returns
the maximum detected difference between two components
 def python.toolsExtended.doDehierarchisation ( alpha, grid )

hierarchisation of the node base values on a grid

Parameters
 alpha DataVector that holds the coefficients of the sparse grid's ansatzfunctions grid thee grid matching to the alpha vector
 def python.toolsExtended.doHierarchisation ( node_values, grid )

hierarchisation of the node base values on a grid

Parameters
 node_values DataVector that holds the coefficients of the function's node base grid the grid matching to the node_vector
 def python.toolsExtended.evalFunction ( function, points )

evalutes a given function

Parameters
 function a string the gives the function; x1...xn must be the names of the placeholders points sorted list of the coordinates (x1...xn) of evaluation point
Returns
returns the function value at points
 def python.toolsExtended.generateBBTMatrix ( factory, training, verbose = False )

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

Parameters
 factory the grid object training DataVector to contains the used training data verbose default:False prints some additional information

Referenced by python.testcondition.calc_condition().

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

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

Parameters
 factory the grid object training DataVector to contains the used training data verbose default:False prints some additional information
 def python.toolsExtended.generateBTMatrix ( factory, training, verbose = False )

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

Parameters
 factory the grid object training DataVector to contains the used training data verbose default:False prints some additional information
 def python.toolsExtended.generateBTMatrixPython ( factory, training, verbose = False )

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

Parameters
 factory the grid object training DataVector to contains the used training data verbose default:False prints some additional information
 def python.toolsExtended.generateCMatrix ( factory, verbose = False )

Generates the Laplace Matrix for a given grid using numpy.

Parameters
 factory the grid object verbose default:False prints some additional information

References sgpp::op_factory.createOperationLaplace().

Referenced by python.testcondition.calc_condition().

 def python.toolsExtended.openFile ( filename )

Opens a file and returns the stored data.

Parameters
 filename of file to open
Returns
the data stored in the file

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

This allows to evaluate a multidimensional function.

Parameters
 filename filename of file with coordinates and function values filenameValue filename of file with function values only grid reference to the Sparse Grid alpha hierarchical surplus of the Sparse Grid's Ansatzfunctions resolution number of evaluating points

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

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

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

Parameters
 p DataVector containing the coordinates of the point grid reference to the Sparse Grid alpha hierarchical surplus of the Sparse Grid's Ansatzfunctions fout filehandle to result file, containing the coordinates and value foutvalue filehandle to resultfile, containing only the value

References sgpp::op_factory.createOperationEval().

Referenced by python.toolsExtended.recGenPrintVector().

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

This allows to evaluate a multidimensional function.

Parameters
 filename filename of file with coordinates and function values filenameValue filename of file with function values only function string that describes the function to evaluate resolution number of evaluating points dim dimension of function

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

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

Writes reference points to a given file.

Parameters
 points string containing the evaluation potins dim the dimension of the function function string that describes the function to evaluate fout filehandle to result file, containing the coordinates and value foutvalue filehandle to resultfile, containing only the value

References python.toolsExtended.evalFunction().

Referenced by python.toolsExtended.recGenPrintRefVector().

Parameters
 filename the filename of the file that contains the data
Returns
returns a data Vector
 def python.toolsExtended.readReferenceMatrix ( storage, filename )

Reads a Reference matrix and returns it.

Parameters
 storage storage of the grid filename the 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().

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

Recursive generation of the function's coordinate string.

Parameters
 dim_rem remaining dimensions dim dimension of function points current coordinate string function string that describes the function to evaluate resolution number of supporting points fout filehandle to result file, containing the coordinates and value foutvalue filehandle to resultfile, containing only the value

References python.toolsExtended.printRefPoint().

Referenced by python.toolsExtended.printRefNDFunction().

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

Evaluates a mutlidimensional function on a Sparse Grid.

Parameters
 dim_rem remaining dimensions p DataVector containing the coordinates of the point grid reference to the Sparse Grid alpha hierarchical surplus of the Sparse Grid's Ansatzfunctions resolution number of evaluating points fout filehandle to result file, containing the coordinates and value foutvalue filehandle to resultfile, containing only the value

References python.toolsExtended.printPoint().

Referenced by python.toolsExtended.printNDFunction().

 def python.toolsExtended.testHierarchisationResults ( node1, node2 )

tests the correctness of the hierarchisation and dehierachisation

Parameters
 node1 the vector of the node base values before hierarchisation and dehierarchisation node2 the vector of the node base values after hierarchisation and dehierarchisation
Returns
maximum error during the transformations
 def python.toolsExtended.writeMatrixToFile ( filename, matrix, n, m )

Writes matrix stored in numpy format into a file.

Parameters
 filename file's filename to which the data is written matrix the matrix that should be stored n number of rows m number of columns

References analyse_erg.file.