SG++-Doxygen-Documentation
|
Free refinement class for sparse grids. More...
#include <HashRefinement.hpp>
Public Member Functions | |
void | free_refine (GridStorage &storage, RefinementFunctor &functor, std::vector< size_t > *addedPoints=0) override |
Refines a grid according to a RefinementFunctor provided. More... | |
size_t | getNumberOfRefinablePoints (GridStorage &storage) override |
Computes and returns the number of grid points, which can be refined. More... | |
void | refineGridpoint1D (GridStorage &storage, GridPoint &point, size_t d) override |
Refine one grid point along a single direction. More... | |
void | refineGridpoint1D (GridStorage &storage, size_t seq, size_t d) override |
Refine one grid point along a single direction. More... | |
virtual | ~HashRefinement () |
Public Member Functions inherited from sgpp::base::AbstractRefinement | |
virtual size_t | getIndexOfMin (RefinementFunctor::value_type *array, size_t length) |
Returns the index of the first occurrence of minimal element in array. More... | |
bool | isRefinable (GridStorage &storage, GridPoint &point) |
Check if the grid point is refinable. More... | |
virtual | ~AbstractRefinement () |
Destructor. More... | |
Protected Member Functions | |
virtual void | addElementToCollection (const GridStorage::grid_map_iterator &iter, AbstractRefinement::refinement_list_type current_value_list, size_t refinements_num, AbstractRefinement::refinement_container_type &collection) |
Adds elements to the collection. More... | |
void | collectRefinablePoints (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) override |
Examines the grid points and stores the indices those that can be refined and have maximal indicator values. More... | |
void | createGridpoint (GridStorage &storage, GridPoint &point) override |
This method creates a new point on the grid. More... | |
AbstractRefinement::refinement_list_type | getIndicator (GridStorage &storage, const GridStorage::grid_map_iterator &iter, const RefinementFunctor &functor) const override |
Generates a list with indicator elements. More... | |
void | refineGridpoint (GridStorage &storage, size_t refine_index) override |
This method refines a grid point by generating the children in every dimension of the grid and all their missing ancestors by calling create_gridpoint(). More... | |
void | refineGridpointsCollection (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) override |
Extends the grid adding elements defined in collection. More... | |
Protected Member Functions inherited from sgpp::base::AbstractRefinement | |
virtual void | createGridpoint1D (GridPoint &point, size_t d, GridStorage &storage, index_t &source_index, level_t &source_level) |
Creates children grid points along single direction. More... | |
virtual void | createGridpointSubroutine (GridStorage &storage, GridPoint &point) |
Subroutine for grid point creation. More... | |
Additional Inherited Members | |
Public Types inherited from sgpp::base::AbstractRefinement | |
typedef std::vector< refinement_pair_type > | refinement_container_type |
Container for the collection of the refinement atoms and the corresponding value. More... | |
typedef AbstractRefinement_refinement_key | refinement_key_type |
Type of the identifier of the refinement atom (e.g. More... | |
typedef std::forward_list< AbstractRefinement::refinement_pair_type > | refinement_list_type |
typedef std::pair< std::shared_ptr< refinement_key_type >, refinement_value_type > | refinement_pair_type |
Pair for the refinement key and value. More... | |
typedef double | refinement_value_type |
Type of functor value assigned to each refinement atom. More... | |
Static Public Member Functions inherited from sgpp::base::AbstractRefinement | |
static bool | compare_pairs (const refinement_pair_type &lhs, const refinement_pair_type &rhs) |
Comparison of the refinement_pair_type. More... | |
Free refinement class for sparse grids.
|
inlinevirtual |
|
protectedvirtual |
Adds elements to the collection.
This method is responsible for selection the elements with most important indicators and to limit the size of collection to refinements_num elements.
iter | storage iterator |
current_value_list | list with elements that contain keys and values that specify refinement |
refinements_num | number of elements to refine |
collection | container where element pairs for refinement need to be stored |
References sgpp::base::AbstractRefinement::compare_pairs().
Referenced by sgpp::base::HashRefinementInteraction::collectRefinablePoints(), sgpp::base::MultipleClassRefinement::collectRefinablePoints(), collectRefinablePoints(), sgpp::optimization::HashRefinementMultiple::collectRefinablePoints(), and ~HashRefinement().
|
overrideprotectedvirtual |
Examines the grid points and stores the indices those that can be refined and have maximal indicator values.
storage | hashmap that stores the grid points |
functor | a PredictiveRefinementIndicator specifying the refinement criteria |
collection | container that contains elements to refine (empty initially) |
Implements sgpp::base::AbstractRefinement.
Reimplemented in sgpp::optimization::HashRefinementMultiple, sgpp::base::MultipleClassRefinement, and sgpp::base::HashRefinementInteraction.
References addElementToCollection(), sgpp::base::HashGridStorage::begin(), sgpp::base::HashGridStorage::end(), sgpp::base::HashGridStorage::find(), sgpp::base::HashGridPoint::get(), sgpp::base::HashGridStorage::getDimension(), getIndicator(), sgpp::base::RefinementFunctor::getRefinementsNum(), chess::point, and sgpp::base::HashGridPoint::set().
Referenced by free_refine(), and ~HashRefinement().
|
overrideprotectedvirtual |
This method creates a new point on the grid.
It checks if some parents or children are needed in other dimensions.
storage | hashmap that stores the gridpoints |
point | The point that should be inserted |
Implements sgpp::base::AbstractRefinement.
Reimplemented in sgpp::base::HashRefinementInconsistent, and sgpp::base::HashRefinementInteraction.
References sgpp::base::AbstractRefinement::createGridpoint1D(), sgpp::base::HashGridStorage::getDimension(), and sgpp::base::HashGridStorage::insert().
Referenced by sgpp::base::MultipleClassRefinement::refineGridpoint(), refineGridpoint1D(), and ~HashRefinement().
|
overridevirtual |
Refines a grid according to a RefinementFunctor provided.
Refines up to RefinementFunctor::getRefinementsNum() grid points if possible, and if their refinement value is larger than RefinementFunctor::start() and their absolute value is larger or equal than RefinementFunctor::getRefinementThreshold() If addedPoints is supplied and not a zero pointer, then newly created grid points are appended to this vector.
storage | hashmap that stores the grid points |
functor | a RefinementFunctor specifying the refinement criteria |
addedPoints | pointer to vector to append newly created grid points to |
Assumption: during the refinement process the only change made to the storage is the following: New (if any) gridpoints are appended (to the end) of the storage
Implements sgpp::base::AbstractRefinement.
References collectRefinablePoints(), sgpp::base::HashGridStorage::getSize(), python.statsfileInfo::i, and refineGridpointsCollection().
Referenced by sgpp::optimization::IterativeGridGeneratorSOO::generate(), sgpp::optimization::IterativeGridGeneratorRitterNovak::generate(), sgpp::base::StandardGridGenerator::refine(), sgpp::datadriven::MultipleClassRefinementFunctor::refine(), and sgpp::base::PrewaveletGridGenerator::refine().
|
overrideprotectedvirtual |
Generates a list with indicator elements.
storage | grid storage |
iter | iterator |
functor | refinement functor |
Implements sgpp::base::AbstractRefinement.
Referenced by sgpp::base::HashRefinementInteraction::collectRefinablePoints(), sgpp::base::MultipleClassRefinement::collectRefinablePoints(), collectRefinablePoints(), sgpp::optimization::HashRefinementMultiple::collectRefinablePoints(), and ~HashRefinement().
|
overridevirtual |
Computes and returns the number of grid points, which can be refined.
This is the number of grid points that have at least one child missing.
storage | hashmap that stores the grid points |
Implements sgpp::base::AbstractRefinement.
Reimplemented in sgpp::optimization::HashRefinementMultiple.
References sgpp::base::HashGridStorage::begin(), analyse_erg::counter, sgpp::base::HashGridStorage::end(), sgpp::base::HashGridStorage::find(), sgpp::base::HashGridPoint::get(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::HashGridStorage::getSize(), chess::point, and sgpp::base::HashGridPoint::set().
Referenced by sgpp::base::StandardGridGenerator::getNumberOfRefinablePoints(), and sgpp::base::PrewaveletGridGenerator::getNumberOfRefinablePoints().
|
overrideprotectedvirtual |
This method refines a grid point by generating the children in every dimension of the grid and all their missing ancestors by calling create_gridpoint().
storage | hashmap that stores the gridpoints |
refine_index | The index in the hashmap of the point that should be refined |
Implements sgpp::base::AbstractRefinement.
Reimplemented in sgpp::base::MultipleClassRefinement.
References sgpp::base::HashGridStorage::getDimension(), chess::point, and refineGridpoint1D().
Referenced by refineGridpointsCollection(), and ~HashRefinement().
|
overridevirtual |
Refine one grid point along a single direction.
storage | hashmap that stores the grid points |
point | point to refine |
d | direction |
Implements sgpp::base::AbstractRefinement.
Reimplemented in sgpp::optimization::HashRefinementMultiple.
References createGridpoint(), sgpp::base::HashGridPoint::get(), sgpp::base::HashGridStorage::isContaining(), sgpp::base::HashGridPoint::set(), and sgpp::base::HashGridPoint::setLeaf().
Referenced by sgpp::base::ANOVAHashRefinement::refineGridpoint(), refineGridpoint(), and refineGridpoint1D().
|
overridevirtual |
Refine one grid point along a single direction.
storage | hashmap that stores the grid points |
seq | sequential number of the grid point |
d | direction |
Reimplemented from sgpp::base::AbstractRefinement.
References sgpp::base::HashGridStorage::getPoint(), and refineGridpoint1D().
|
overrideprotectedvirtual |
Extends the grid adding elements defined in collection.
storage | hashmap that stores the grid points |
functor | a PredictiveRefinementIndicator specifying the refinement criteria |
collection | container that contains elements to refine (empty initially) |
Implements sgpp::base::AbstractRefinement.
References sgpp::base::RefinementFunctor::getRefinementThreshold(), and refineGridpoint().
Referenced by free_refine(), and ~HashRefinement().