![]() |
SG++-Doxygen-Documentation
|
#include <ForwardSelectorRefinement.hpp>
Public Types | |
typedef ForwardSelectorRefinement_refinement_key | refinement_key_type |
![]() | |
typedef std::vector< refinement_pair_type > | refinement_container_type |
Container for the collection of the refinement atoms and the corresponding value. | |
typedef AbstractRefinement_refinement_key | refinement_key_type |
Type of the identifier of the refinement atom (e.g. | |
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. | |
typedef double | refinement_value_type |
Type of functor value assigned to each refinement atom. | |
Public Member Functions | |
ForwardSelectorRefinement (AbstractRefinement *refinement) | |
void | free_refine (GridStorage &storage, ForwardSelectorRefinementIndicator &functor) |
Refines a grid according to the ForwardSelectorRefinementIndicator provided. | |
virtual void | free_refine (GridStorage &storage, RefinementFunctor &functor, std::vector< size_t > *addedPoints=nullptr) |
Refines a grid according to a RefinementFunctor provided. | |
![]() | |
bool | checkAdmissibility (GridStorage &storage, GridPoint &subspace) |
virtual size_t | getNumberOfRefinablePoints (GridStorage &storage) |
Computes and returns the number of grid points, which can be refined. | |
virtual void | refineGridpoint1D (GridStorage &storage, GridPoint &point, size_t d) |
Refine one grid point along a single direction. | |
RefinementDecorator (AbstractRefinement *refinement) | |
Constructor. | |
virtual | ~RefinementDecorator () |
![]() | |
virtual size_t | getIndexOfMin (RefinementFunctor::value_type *array, size_t length) |
Returns the index of the first occurrence of minimal element in array. | |
bool | isRefinable (GridStorage &storage, GridPoint &point) |
Check if the grid point is refinable. | |
virtual void | refineGridpoint1D (GridStorage &storage, size_t seq, size_t d) |
Refine one grid point along a single direction. | |
virtual | ~AbstractRefinement () |
Destructor. | |
Protected Member Functions | |
virtual void | addElementToCollection (const GridStorage::grid_map_iterator &iter, AbstractRefinement::refinement_list_type current_value_list, size_t refinementsNum, AbstractRefinement::refinement_container_type &collection) |
Adds elements to the collection. | |
void | collectRefinablePoints (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) override |
Examines the grid points and stores the indices of those that can be refined and have largest indicator values. | |
AbstractRefinement::refinement_list_type | getIndicator (GridStorage &storage, const GridStorage::grid_map_iterator &iter, const RefinementFunctor &functor) const override |
Generates a list with indicator elements. | |
virtual void | refineGridpointsCollection (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) |
Refines the collection of points. | |
void | refineGridpointsCollection (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) override |
Extends the grid adding grid points defined in the collection. | |
![]() | |
virtual void | createGridpoint (GridStorage &storage, GridPoint &point) |
This method creates a new point on the grid. | |
AbstractRefinement * | get_decorated_refinement () |
Returns the pointer to decorated Refinement object. | |
virtual void | refineGridpoint (GridStorage &storage, size_t refine_index) |
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(). | |
void | set_decorated_refiment (AbstractRefinement *refinement) |
Sets the pointer of the decorated Refinement object to the given object. | |
![]() | |
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. | |
virtual void | createGridpointSubroutine (GridStorage &storage, GridPoint &point) |
Subroutine for grid point creation. | |
Additional Inherited Members | |
![]() | |
static bool | compare_pairs (const refinement_pair_type &lhs, const refinement_pair_type &rhs) |
Comparison of the refinement_pair_type. | |
typedef ForwardSelectorRefinement_refinement_key sgpp::base::ForwardSelectorRefinement::refinement_key_type |
|
inlineexplicit |
|
protectedvirtual |
Adds elements to the collection.
This method is responsible for the selection of the elements with largest indicator values and to limit the size of the collection to refinementsNum elements.
iter | Storage iterator |
current_value_list | List with elements that contain keys and values that specify refinement indicator |
refinementsNum | Number of grid points to refine |
collection | Container where element pairs for refinement need to be stored |
References sgpp::base::AbstractRefinement::compare_pairs().
Referenced by collectRefinablePoints().
|
overrideprotectedvirtual |
Examines the grid points and stores the indices of those that can be refined and have largest indicator values.
storage | Hashmap that stores the grid points |
functor | A ForwardSelectorRefinementIndicator specifying the refinement criteria |
collection | Container that contains elements to refine (empty initially) |
Reimplemented from sgpp::base::RefinementDecorator.
References addElementToCollection(), sgpp::base::HashGridStorage::begin(), sgpp::base::HashGridStorage::end(), getIndicator(), and sgpp::base::RefinementFunctor::getRefinementsNum().
Referenced by free_refine().
void sgpp::base::ForwardSelectorRefinement::free_refine | ( | GridStorage & | storage, |
ForwardSelectorRefinementIndicator & | functor | ||
) |
Refines a grid according to the ForwardSelectorRefinementIndicator provided.
storage | Hashmap that stores the grid points |
functor | A RefinementFunctor specifying the refinement criteria |
References collectRefinablePoints(), sgpp::base::HashGridStorage::getSize(), and refineGridpointsCollection().
Referenced by sgpp::datadriven::LearnerSVM::train().
|
virtual |
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()
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 |
Reimplemented from sgpp::base::RefinementDecorator.
|
overrideprotectedvirtual |
Generates a list with indicator elements.
storage | Grid storage |
iter | Iterator |
functor | Refinement functor |
Reimplemented from sgpp::base::RefinementDecorator.
References sgpp::base::HashGridStorage::end(), sgpp::base::HashGridStorage::find(), sgpp::base::HashGridStorage::getDimension(), sgpp::base::ForwardSelectorRefinementIndicator::getRefinementThreshold(), and sgpp::base::HashGridStorage::getSequenceNumber().
Referenced by collectRefinablePoints().
|
protectedvirtual |
Refines the collection of points.
storage | hashmap that stores the grid points |
functor | a PredictiveRefinementIndicator specifying the refinement criteria |
collection | container that contains elements to refine (empty initially) |
Reimplemented from sgpp::base::RefinementDecorator.
|
overrideprotectedvirtual |
Extends the grid adding grid points defined in the collection.
storage | Hashmap that stores the grid points |
functor | A ForwardSelectorRefinementIndicator specifying the refinement criteria |
collection | Container that contains elements to refine (empty initially) |
Reimplemented from sgpp::base::RefinementDecorator.
References sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSequenceNumber(), sgpp::base::HashGridStorage::getSize(), sgpp::base::RefinementDecorator::refineGridpoint(), and sgpp::base::ForwardSelectorRefinementIndicator::update().
Referenced by free_refine().