SG++-Doxygen-Documentation
Generalised Sparse Grids

This example creates a generalised grid.

The first command line argument is the number of dimensions, the second is the level, and the third is the parameter T. It then prints out the grid size.

1 from pysgpp import *
2 import sys
3 
4 if len(sys.argv) != 4:
5  print("The number of arguments is wrong, but the answer is 42")
6 else:
7  dimensions = int(sys.argv[1])
8  level = int(sys.argv[2])
9  T = float(sys.argv[3])
10 
11  grid = Grid.createModLinearGrid(dimensions)
12  generator = grid.getGenerator()
13  generator.regular(level, T)
14  print(grid.getSize())