![]()  | 
  
    SG++-Doxygen-Documentation
    
   | 
 
Iterative grid generation based on linear surplusses. More...
#include <IterativeGridGeneratorLinearSurplus.hpp>
  
 Public Member Functions | |
| bool | generate () override | 
| Generate the grid.  More... | |
| double | getAdaptivity () const | 
| base::level_t | getInitialLevel () const | 
| IterativeGridGeneratorLinearSurplus (ScalarFunction &f, base::Grid &grid, size_t N, double adaptivity=DEFAULT_ADAPTIVITY, base::level_t initialLevel=DEFAULT_INITIAL_LEVEL) | |
| Constructor.  More... | |
| void | setAdaptivity (double adaptivity) | 
| void | setInitialLevel (base::level_t initialLevel) | 
| ~IterativeGridGeneratorLinearSurplus () override | |
| Destructor.  More... | |
  Public Member Functions inherited from sgpp::optimization::IterativeGridGenerator | |
| const base::DataVector & | getFunctionValues () const | 
| base::Grid & | getGrid () const | 
| IterativeGridGenerator (ScalarFunction &f, base::Grid &grid, size_t N) | |
| Constructor.  More... | |
| virtual | ~IterativeGridGenerator () | 
| Destructor.  More... | |
Static Public Attributes | |
| static constexpr double | DEFAULT_ADAPTIVITY = 0.2 | 
| default adaptivity  More... | |
| static const base::level_t | DEFAULT_INITIAL_LEVEL = 3 | 
| default level of initial regular sparse grid  More... | |
Protected Attributes | |
| double | gamma | 
| adaptivity  More... | |
| base::level_t | initialLevel | 
| level of initial regular sparse grid  More... | |
| std::unique_ptr< base::Grid > | linearGrid | 
| pointer to a linear grid (of the same type as the "real" grid)  More... | |
  Protected Attributes inherited from sgpp::optimization::IterativeGridGenerator | |
| ScalarFunction & | f | 
| objective function  More... | |
| base::DataVector | functionValues | 
| vector of function values at the grid points  More... | |
| base::Grid & | grid | 
| underlying grid  More... | |
| size_t | N | 
| maximal number of grid points  More... | |
Additional Inherited Members | |
  Protected Member Functions inherited from sgpp::optimization::IterativeGridGenerator | |
| void | evalFunction (size_t oldGridSize=0) | 
| Evaluates the objective function at grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] and saves values in functionValues.  More... | |
| void | undoRefinement (size_t oldGridSize) | 
| Removes grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] from the grid.  More... | |
Iterative grid generation based on linear surplusses.
In each iteration, the fraction of \(gamma\) (e.g. \(\gamma = 0.2\) means 20%) of the grid points with the largest hierarchical linear surplusses are refined.
| sgpp::optimization::IterativeGridGeneratorLinearSurplus::IterativeGridGeneratorLinearSurplus | ( | ScalarFunction & | f, | 
| base::Grid & | grid, | ||
| size_t | N, | ||
| double | adaptivity = DEFAULT_ADAPTIVITY,  | 
        ||
| base::level_t | initialLevel = DEFAULT_INITIAL_LEVEL  | 
        ||
| ) | 
Constructor.
Do not destruct the grid before this object!
| f | objective function | 
| grid | grid (should be empty) | 
| N | maximal number of grid points | 
| adaptivity | adaptivity between 0 and 1 | 
| initialLevel | level of initial regular sparse grid | 
References sgpp::base::Bspline, sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::FundamentalSpline, sgpp::optimization::ScalarFunction::getNumberOfParameters(), sgpp::base::Grid::getType(), sgpp::base::Linear, sgpp::base::LinearBoundary, sgpp::base::LinearClenshawCurtisBoundary, linearGrid, sgpp::base::ModBspline, sgpp::base::ModBsplineClenshawCurtis, sgpp::base::ModFundamentalSpline, sgpp::base::ModLinear, sgpp::base::ModWavelet, sgpp::base::Wavelet, and sgpp::base::WaveletBoundary.
      
  | 
  override | 
Destructor.
      
  | 
  overridevirtual | 
Generate the grid.
Implements sgpp::optimization::IterativeGridGenerator.
References sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::optimization::Printer::disableStatusPrinting(), sgpp::optimization::Printer::enableStatusPrinting(), sgpp::optimization::IterativeGridGenerator::evalFunction(), sgpp::optimization::IterativeGridGenerator::functionValues, gamma, sgpp::base::Grid::getGenerator(), sgpp::optimization::Printer::getInstance(), sgpp::optimization::HierarchisationSLE::getMatrixEntry(), sgpp::base::DataVector::getPointer(), sgpp::base::Grid::getStorage(), sgpp::base::Grid::getType(), sgpp::optimization::IterativeGridGenerator::grid, python.utils.sg_projections::gridStorage, python.statsfileInfo::i, initialLevel, python.utils.statsfile2gnuplot::j, sgpp::base::LinearBoundary, sgpp::base::LinearClenshawCurtisBoundary, linearGrid, sgpp::optimization::IterativeGridGenerator::N, sgpp::optimization::Printer::printStatusBegin(), sgpp::optimization::Printer::printStatusEnd(), sgpp::optimization::Printer::printStatusUpdate(), sgpp::base::GridGenerator::regular(), sgpp::base::DataVector::setAll(), sgpp::optimization::IterativeGridGenerator::undoRefinement(), and sgpp::base::WaveletBoundary.
| double sgpp::optimization::IterativeGridGeneratorLinearSurplus::getAdaptivity | ( | ) | const | 
References gamma.
| base::level_t sgpp::optimization::IterativeGridGeneratorLinearSurplus::getInitialLevel | ( | ) | const | 
References initialLevel.
| void sgpp::optimization::IterativeGridGeneratorLinearSurplus::setAdaptivity | ( | double | adaptivity | ) | 
| adaptivity | adaptivity between 0 and 1 | 
References gamma.
| void sgpp::optimization::IterativeGridGeneratorLinearSurplus::setInitialLevel | ( | base::level_t | initialLevel | ) | 
| initialLevel | level of initial regular sparse grid | 
References initialLevel.
      
  | 
  static | 
default adaptivity
      
  | 
  static | 
default level of initial regular sparse grid
      
  | 
  protected | 
adaptivity
Referenced by generate(), getAdaptivity(), and setAdaptivity().
      
  | 
  protected | 
level of initial regular sparse grid
Referenced by generate(), getInitialLevel(), and setInitialLevel().
      
  | 
  protected | 
pointer to a linear grid (of the same type as the "real" grid)
Referenced by generate(), and IterativeGridGeneratorLinearSurplus().