![]() |
SG++-Doxygen-Documentation
|
The AdaptiveCombinationGridGenerator is a (potentially changing) representation of a combination grid that also tracks the Quantities of Interest; in contrast to a CombinationGrid, it stores the full downward closed set of levels. More...
#include <AdaptiveCombinationGridGenerator.hpp>
Public Member Functions | |
bool | adaptAllKnown () |
add all subspaces of known result to the old set | |
AdaptiveCombinationGridGenerator (const std::vector< LevelVector > &levelVectors, const std::vector< double > &&QoIValues, std::function< double(double, double)> summationFunction, std::shared_ptr< RelevanceCalculator > relevanceCalculator=std::shared_ptr< RelevanceCalculator >(new WeightedRelevanceCalculator()), std::shared_ptr< PriorityEstimator > priorityEstimator=std::shared_ptr< PriorityEstimator >(new AveragingPriorityEstimator())) | |
Construct a new AdaptiveCombinationGridGenerator object. | |
AdaptiveCombinationGridGenerator (const std::vector< LevelVector > &levelVectors, std::function< double(double, double)> summationFunction, std::shared_ptr< RelevanceCalculator > relevanceCalculator=std::shared_ptr< RelevanceCalculator >(new WeightedRelevanceCalculator()), std::shared_ptr< PriorityEstimator > priorityEstimator=std::shared_ptr< PriorityEstimator >(new AveragingPriorityEstimator())) | |
like above, with default QoI values if they are not supplied | |
AdaptiveCombinationGridGenerator (const std::vector< LevelVector > &levelVectors, std::shared_ptr< RelevanceCalculator > relevanceCalculator=std::shared_ptr< RelevanceCalculator >(new WeightedRelevanceCalculator()), std::shared_ptr< PriorityEstimator > priorityEstimator=std::shared_ptr< PriorityEstimator >(new AveragingPriorityEstimator())) | |
like above, but setting the summationFunction to std::plus<double>() by default | |
bool | adaptNextLevelVector (bool regular=false) |
add the next most important subspace of known result to the old set | |
std::vector< LevelVector > | getActiveSet () const |
Get the level vectors of the active set (= admissible upward neighbors of the old set) | |
CombinationGrid | getCombinationGrid (const HeterogeneousBasis &basis, bool hasBoundary=true) const |
Get the the currently valid combination grid consisting of the "old set" (the combination grid only holds the full grid vectors with non-zero coefficients) | |
double | getCurrentResult () const |
Get current result based on the old set. | |
double | getDelta (const LevelVector &levelVector) const |
Get the delta belonging to a level vector. | |
std::vector< double > | getDeltas (const std::vector< LevelVector > &levelVectors) const |
Get the deltas belonging to the list of supplied level vectors. | |
std::vector< LevelVector > | getLevels () const |
Get the level vectors of the active set (= admissible upward neighbors of the old set) | |
const LevelVector & | getMinimumLevelVector () const |
Get the minimum Level Vector object. | |
std::vector< LevelVector > | getOldSet () const |
Get the level vectors of the old set. | |
std::map< LevelVector, double > | getPriorities () const |
get the levels and priority of elements in the active set that don't have a result / QoI value / delta yet | |
std::vector< LevelVector > | getPriorityQueue () const |
get a priority queue of elements in the active set that don't have a result / QoI / delta yet | |
double | getQoIInformation (const LevelVector &level) |
get QoI information / the stored result for LevelVector level | |
std::map< LevelVector, double > | getRelevanceOfActiveSet () const |
get exact value of relevance / "error" of those elements in the active set that already have a QoI value | |
const std::map< LevelVector, double > & | getSubspacesAndQoIs () const |
Get the subspacesAndQoIs object. | |
bool | hasQoIInformation (const LevelVector &level) |
is Qoi information stored for LevelVector level? | |
void | setQoIInformation (const LevelVector &level, double qoi) |
set QoI information / a result for LevelVector level | |
Static Public Member Functions | |
static AdaptiveCombinationGridGenerator | fromCombinationGrid (const CombinationGrid &combinationGrid, const std::vector< double > &&QoIValues, std::function< double(double, double)> summationFunction=std::plus< double >(), std::shared_ptr< RelevanceCalculator > relevanceCalculator=std::shared_ptr< RelevanceCalculator >(new WeightedRelevanceCalculator()), std::shared_ptr< PriorityEstimator > priorityEstimator=std::shared_ptr< PriorityEstimator >(new AveragingPriorityEstimator())) |
Construct a new AdaptiveCombinationGridGenerator object. | |
static AdaptiveCombinationGridGenerator | fromCombinationGrid (const CombinationGrid &combinationGrid, std::function< double(double, double)> summationFunction=std::plus< double >(), std::shared_ptr< RelevanceCalculator > relevanceCalculator=std::shared_ptr< RelevanceCalculator >(new WeightedRelevanceCalculator()), std::shared_ptr< PriorityEstimator > priorityEstimator=std::shared_ptr< PriorityEstimator >(new AveragingPriorityEstimator())) |
like above, with default QoI values if they are not supplied | |
The AdaptiveCombinationGridGenerator is a (potentially changing) representation of a combination grid that also tracks the Quantities of Interest; in contrast to a CombinationGrid, it stores the full downward closed set of levels.
The adaptation is performed based on a scalar Quantity of Interest passed to the AdaptiveCombinationGridGenerator via setQoIInformation
.
There are – potentially – three categories of level vectors in an AdaptiveCombinationGridGenerator, those that are already selected by the adaptive algorithm ("old set"), candidates for the old set which are not yet selected whose QoIs we may or may not yet know ("active set"), and others that are outside either of those (whose QoI we are already storing for later use).
When doing adaptation by adaptNextLevelVector
, an admissible level vector is moved from the active to the old set. That level vector will be selected by the relevanceCalculator
based on delta, a measure for how much the combined QoI will change if a particular level vector would be added.
If grid evaluations are expensive and one would like to know which QoIs should be computed next, a priority queue can be obtained by getPriorityQueue
, which uses the priorityEstimator
to infer a priority for the active set levels from the QoIs of the downward neighbors.
Terminology is mostly taken from Gerstner, T. and Griebel, M., 2003. Dimension–adaptive tensor–product quadrature. Computing, 71(1), pp.65-87.
sgpp::combigrid::AdaptiveCombinationGridGenerator::AdaptiveCombinationGridGenerator | ( | const std::vector< LevelVector > & | levelVectors, |
const std::vector< double > && | QoIValues, | ||
std::function< double(double, double)> | summationFunction, | ||
std::shared_ptr< RelevanceCalculator > | relevanceCalculator = std::shared_ptr<RelevanceCalculator>(new WeightedRelevanceCalculator()) , |
||
std::shared_ptr< PriorityEstimator > | priorityEstimator = std::shared_ptr<PriorityEstimator>(new AveragingPriorityEstimator()) |
||
) |
Construct a new AdaptiveCombinationGridGenerator object.
levelVectors | start with these level vectors, cannot be empty |
QoIValues | the QoI values corresponding to levelVectors, same length as levelVectors |
summationFunction | the summation function by which results are combined |
relevanceCalculator | a relevance calculator relating deltas and level vectors to an "error"/relevance estimate |
priorityEstimator | a priority estimator to get the priority of a level / subspace whose result we don't yet know (similar to relevanceCalculator, but based on the deltas of the downward neighbors instead of the level's own delta) |
References level, and sgpp::combigrid::LevelVectorTools::makeDownwardClosed().
|
inline |
like above, with default QoI values if they are not supplied
|
inline |
like above, but setting the summationFunction to std::plus<double>() by default
bool sgpp::combigrid::AdaptiveCombinationGridGenerator::adaptAllKnown | ( | ) |
add all subspaces of known result to the old set
References adaptNextLevelVector().
bool sgpp::combigrid::AdaptiveCombinationGridGenerator::adaptNextLevelVector | ( | bool | regular = false | ) |
add the next most important subspace of known result to the old set
regular | add only subspaces of the next regular level, or none |
References getRelevanceOfActiveSet().
Referenced by adaptAllKnown().
|
static |
Construct a new AdaptiveCombinationGridGenerator object.
combinationGrid | start with the subspaces contained in combinationGrid (must be at least one) |
QoIValues | the QoI values corresponding to levelVectors, same length as the number of FullGrids in combinationGrid |
summationFunction | the summation function by which results are combined |
relevanceCalculator | a relevance calculator relating deltas and level vectors to an "error"/relevance estimate |
priorityEstimator | a priority estimator to get the priority of a level / subspace whose result we don't yet know (similar to relevanceCalculator, but based on the deltas of the downward neighbors instead of the level's own delta) |
References sgpp::combigrid::CombinationGrid::getFullGrids().
Referenced by fromCombinationGrid().
|
inlinestatic |
like above, with default QoI values if they are not supplied
References fromCombinationGrid(), and sgpp::combigrid::CombinationGrid::getFullGrids().
std::vector< LevelVector > sgpp::combigrid::AdaptiveCombinationGridGenerator::getActiveSet | ( | ) | const |
Get the level vectors of the active set (= admissible upward neighbors of the old set)
Referenced by getLevels().
CombinationGrid sgpp::combigrid::AdaptiveCombinationGridGenerator::getCombinationGrid | ( | const HeterogeneousBasis & | basis, |
bool | hasBoundary = true |
||
) | const |
Get the the currently valid combination grid consisting of the "old set" (the combination grid only holds the full grid vectors with non-zero coefficients)
References sgpp::combigrid::CombinationGrid::fromSubspaces(), getOldSet(), and sgpp::combigrid::getStandardCoefficientsFromLevelSet().
double sgpp::combigrid::AdaptiveCombinationGridGenerator::getCurrentResult | ( | ) | const |
Get current result based on the old set.
References getOldSet(), and sgpp::combigrid::getStandardCoefficientsFromLevelSet().
double sgpp::combigrid::AdaptiveCombinationGridGenerator::getDelta | ( | const LevelVector & | levelVector | ) | const |
Get the delta belonging to a level vector.
Delta denotes by how much the combined value of QoI would be influenced if this level vector would be adapted to
References sgpp::combigrid::LevelVectorTools::generateHyperCube().
Referenced by getDeltas(), getPriorities(), and getRelevanceOfActiveSet().
std::vector< double > sgpp::combigrid::AdaptiveCombinationGridGenerator::getDeltas | ( | const std::vector< LevelVector > & | levelVectors | ) | const |
Get the deltas belonging to the list of supplied level vectors.
References getDelta().
std::vector< LevelVector > sgpp::combigrid::AdaptiveCombinationGridGenerator::getLevels | ( | ) | const |
Get the level vectors of the active set (= admissible upward neighbors of the old set)
References getActiveSet(), and getOldSet().
|
inline |
Get the minimum Level Vector object.
|
inline |
Get the level vectors of the old set.
Referenced by getCombinationGrid(), getCurrentResult(), and getLevels().
std::map< LevelVector, double > sgpp::combigrid::AdaptiveCombinationGridGenerator::getPriorities | ( | ) | const |
get the levels and priority of elements in the active set that don't have a result / QoI value / delta yet
References getDelta().
Referenced by getPriorityQueue().
std::vector< LevelVector > sgpp::combigrid::AdaptiveCombinationGridGenerator::getPriorityQueue | ( | ) | const |
get a priority queue of elements in the active set that don't have a result / QoI / delta yet
References getPriorities().
|
inline |
get QoI information / the stored result for LevelVector level
References level.
std::map< LevelVector, double > sgpp::combigrid::AdaptiveCombinationGridGenerator::getRelevanceOfActiveSet | ( | ) | const |
get exact value of relevance / "error" of those elements in the active set that already have a QoI value
References getDelta().
Referenced by adaptNextLevelVector().
|
inline |
Get the subspacesAndQoIs object.
|
inline |
is Qoi information stored for LevelVector level?
References level.
|
inline |
set QoI information / a result for LevelVector level
References level.