SG++-Doxygen-Documentation
sgpp::base::ImpurityRefinement Class Reference

#include <ImpurityRefinement.hpp>

Inheritance diagram for sgpp::base::ImpurityRefinement:
sgpp::base::RefinementDecorator sgpp::base::AbstractRefinement

Public Types

typedef ImpurityRefinement_refinement_key refinement_key_type
 
- Public Types inherited from sgpp::base::AbstractRefinement
typedef std::vector< refinement_pair_typerefinement_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_typerefinement_list_type
 
typedef std::pair< std::shared_ptr< refinement_key_type >, refinement_value_typerefinement_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...
 

Public Member Functions

void free_refine (GridStorage &storage, ImpurityRefinementIndicator &functor)
 Refines a grid according to the impurity refinement indicator provided. More...
 
 ImpurityRefinement (AbstractRefinement *refinement)
 
- Public Member Functions inherited from sgpp::base::RefinementDecorator
bool checkAdmissibility (GridStorage &storage, GridPoint &subspace)
 
virtual void free_refine (GridStorage &storage, RefinementFunctor &functor, std::vector< size_t > *addedPoints=0)
 Refines a grid according to a RefinementFunctor provided. More...
 
virtual size_t getNumberOfRefinablePoints (GridStorage &storage)
 Computes and returns the number of grid points, which can be refined. More...
 
virtual void refineGridpoint1D (GridStorage &storage, GridPoint &point, size_t d)
 Refine one grid point along a single direction. More...
 
 RefinementDecorator (AbstractRefinement *refinement)
 Constructor. More...
 
virtual ~RefinementDecorator ()
 
- 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 void refineGridpoint1D (GridStorage &storage, size_t seq, size_t d)
 Refine one grid point along a single direction. 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 refinementsNum, 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 of those that can be refined and have maximal indicator values. 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 refineGridpointsCollection (GridStorage &storage, RefinementFunctor &functor, AbstractRefinement::refinement_container_type &collection) override
 Extends the grid adding points defined in the collection. More...
 
- Protected Member Functions inherited from sgpp::base::RefinementDecorator
virtual void createGridpoint (GridStorage &storage, GridPoint &point)
 This method creates a new point on the grid. More...
 
AbstractRefinementget_decorated_refinement ()
 Returns the pointer to decorated Refinement object. More...
 
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(). More...
 
void set_decorated_refiment (AbstractRefinement *refinement)
 Sets the pointer of the decorated Refinement object to the given object. 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

- 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...
 

Member Typedef Documentation

Constructor & Destructor Documentation

sgpp::base::ImpurityRefinement::ImpurityRefinement ( AbstractRefinement refinement)
inlineexplicit

Member Function Documentation

void sgpp::base::ImpurityRefinement::addElementToCollection ( const GridStorage::grid_map_iterator iter,
AbstractRefinement::refinement_list_type  current_value_list,
size_t  refinementsNum,
AbstractRefinement::refinement_container_type collection 
)
protectedvirtual

Adds elements to the collection.

This method is responsible for selection of the elements with largest indicator values and to limit the size of collection to refinementsNum elements.

Parameters
iterStorage iterator
current_value_listList with elements that contain keys and values that specify refinement
refinementsNumNumber of grid points to refine
collectionContainer where element pairs for refinement need to be stored

References sgpp::base::AbstractRefinement::compare_pairs().

Referenced by collectRefinablePoints().

void sgpp::base::ImpurityRefinement::collectRefinablePoints ( GridStorage storage,
RefinementFunctor functor,
AbstractRefinement::refinement_container_type collection 
)
overrideprotectedvirtual

Examines the grid points and stores the indices of those that can be refined and have maximal indicator values.

Parameters
storageHashmap that stores the grid points
functorAn impurity indicator specifying the refinement criteria
collectionContainer 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::ImpurityRefinement::free_refine ( GridStorage storage,
ImpurityRefinementIndicator functor 
)

Refines a grid according to the impurity refinement indicator provided.

Parameters
storageHashmap that stores the grid points
functorA RefinementFunctor specifying the refinement criteria

References collectRefinablePoints(), sgpp::base::HashGridStorage::getSize(), and refineGridpointsCollection().

Referenced by sgpp::datadriven::LearnerSGD::train(), and sgpp::datadriven::LearnerSVM::train().

AbstractRefinement::refinement_list_type sgpp::base::ImpurityRefinement::getIndicator ( GridStorage storage,
const GridStorage::grid_map_iterator iter,
const RefinementFunctor functor 
) const
overrideprotectedvirtual
void sgpp::base::ImpurityRefinement::refineGridpointsCollection ( GridStorage storage,
RefinementFunctor functor,
AbstractRefinement::refinement_container_type collection 
)
overrideprotectedvirtual

Extends the grid adding points defined in the collection.

Parameters
storageHashmap that stores the grid points
functorAn impurity indicator specifying the refinement criteria
collectionContainer that contains elements to refine (empty initially)

Reimplemented from sgpp::base::RefinementDecorator.

References sgpp::base::ImpurityRefinementIndicator::alphas, sgpp::base::AbstractRefinement_refinement_key::getPoint(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSequenceNumber(), sgpp::base::HashGridStorage::getSize(), chess::point, sgpp::base::RefinementDecorator::refineGridpoint(), sgpp::base::HashGridPoint::setLeaf(), sgpp::base::ImpurityRefinementIndicator::update(), and sgpp::base::ImpurityRefinementIndicator::w1.

Referenced by free_refine().


The documentation for this class was generated from the following files: