![]() |
SG++-Doxygen-Documentation
|
Iterative grid generation based on linear surplusses. More...
#include <IterativeGridGeneratorLinearSurplus.hpp>
Public Member Functions | |
bool | generate () override |
Generate the grid. | |
double | getAdaptivity () const |
base::level_t | getInitialLevel () const |
IterativeGridGeneratorLinearSurplus (base::ScalarFunction &f, base::Grid &grid, size_t N, double adaptivity=DEFAULT_ADAPTIVITY, base::level_t initialLevel=DEFAULT_INITIAL_LEVEL) | |
Constructor. | |
void | setAdaptivity (double adaptivity) |
void | setInitialLevel (base::level_t initialLevel) |
~IterativeGridGeneratorLinearSurplus () override | |
Destructor. | |
![]() | |
const base::DataVector & | getFunctionValues () const |
base::Grid & | getGrid () const |
IterativeGridGenerator (base::ScalarFunction &f, base::Grid &grid, size_t N) | |
Constructor. | |
void | printIterativeGridGenerator () const |
Prints grid points and function values. | |
virtual | ~IterativeGridGenerator () |
Destructor. | |
Static Public Attributes | |
static constexpr double | DEFAULT_ADAPTIVITY = 0.2 |
default adaptivity | |
static const base::level_t | DEFAULT_INITIAL_LEVEL = 3 |
default level of initial regular sparse grid | |
Protected Attributes | |
double | gamma |
adaptivity | |
base::level_t | initialLevel |
level of initial regular sparse grid | |
std::unique_ptr< base::Grid > | linearGrid |
pointer to a linear grid (of the same type as the "real" grid) | |
![]() | |
base::ScalarFunction & | f |
objective function | |
base::DataVector | functionValues |
vector of function values at the grid points | |
base::Grid & | grid |
underlying grid | |
size_t | N |
maximal number of grid points | |
Additional Inherited Members | |
![]() | |
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. | |
void | undoRefinement (size_t oldGridSize) |
Removes grid points with indices [oldGridSize, oldGridSize + 1, ..., grid.getSize() - 1] from the grid. | |
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 | ( | base::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::optimization::IterativeGridGenerator::f, sgpp::base::FundamentalNakSplineBoundary, sgpp::base::FundamentalSpline, sgpp::base::FundamentalSplineBoundary, sgpp::base::ScalarFunction::getNumberOfParameters(), sgpp::base::Grid::getType(), sgpp::optimization::IterativeGridGenerator::grid, sgpp::base::Linear, sgpp::base::LinearBoundary, sgpp::base::LinearClenshawCurtis, sgpp::base::LinearClenshawCurtisBoundary, linearGrid, sgpp::base::ModBspline, sgpp::base::ModBsplineClenshawCurtis, sgpp::base::ModFundamentalSpline, sgpp::base::ModLinear, sgpp::base::ModNakBspline, sgpp::base::ModWavelet, sgpp::base::ModWeaklyFundamentalNakSpline, sgpp::base::NakBspline, sgpp::base::NakBsplineBoundary, sgpp::base::NakBsplineExtended, sgpp::base::NaturalBsplineBoundary, sgpp::base::Wavelet, sgpp::base::WaveletBoundary, sgpp::base::WeaklyFundamentalNakSplineBoundary, and sgpp::base::WeaklyFundamentalSplineBoundary.
|
override |
Destructor.
|
overridevirtual |
Generate the grid.
Implements sgpp::optimization::IterativeGridGenerator.
References sgpp::base::BsplineBoundary, sgpp::base::BsplineClenshawCurtis, sgpp::base::Printer::disableStatusPrinting(), sgpp::base::Printer::enableStatusPrinting(), sgpp::optimization::IterativeGridGenerator::evalFunction(), sgpp::optimization::IterativeGridGenerator::functionValues, gamma, sgpp::base::Grid::getGenerator(), sgpp::base::Printer::getInstance(), sgpp::base::HierarchisationSLE::getMatrixEntry(), sgpp::base::DataVector::getPointer(), sgpp::base::Grid::getStorage(), sgpp::base::Grid::getType(), sgpp::optimization::IterativeGridGenerator::grid, initialLevel, sgpp::base::LinearBoundary, sgpp::base::LinearClenshawCurtisBoundary, linearGrid, sgpp::optimization::IterativeGridGenerator::N, sgpp::base::NakBsplineBoundary, sgpp::base::NaturalBsplineBoundary, sgpp::base::Printer::printStatusBegin(), sgpp::base::Printer::printStatusEnd(), sgpp::base::Printer::printStatusUpdate(), sgpp::base::GridGenerator::regular(), sgpp::base::DataVector::setAll(), sgpp::base::sle_solver::BiCGStab::solve(), sgpp::optimization::IterativeGridGenerator::undoRefinement(), sgpp::base::WaveletBoundary, sgpp::base::WeaklyFundamentalNakSplineBoundary, and sgpp::base::WeaklyFundamentalSplineBoundary.
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.
|
staticconstexpr |
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().