SG++-Doxygen-Documentation
|
Refinement class for sparse grids. More...
#include <MultipleClassRefinement.hpp>
Public Member Functions | |
MultipleClassRefinement (Grid &grid, std::vector< sgpp::base::MultipleClassPoint > *pts, std::vector< Grid *> &classGrids, double &borderSum, double &borderCnt, double topPercent) | |
Constructor. More... | |
virtual | ~MultipleClassRefinement () |
Public Member Functions inherited from sgpp::base::HashRefinement | |
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 | |
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 | 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... | |
Protected Member Functions inherited from sgpp::base::HashRefinement | |
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 | 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 | 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... | |
Refinement class for sparse grids.
Used by the MultipleClassRefinementFuntor. Scores all grid points and refines points based on the information given in the vector of MulitpleClassPoint
sgpp::base::MultipleClassRefinement::MultipleClassRefinement | ( | Grid & | grid, |
std::vector< sgpp::base::MultipleClassPoint > * | pts, | ||
std::vector< Grid *> & | classGrids, | ||
double & | borderSum, | ||
double & | borderCnt, | ||
double | topPercent | ||
) |
Constructor.
grid | Combined grid. current_grid_index specifies the grid to be refined |
pts | Vector of MultipleClassPoint with additional information |
classGrids | Vector of grids |
borderSum | Sum of the border scores for all points |
borderCnt | amount of points scored towards the border |
topPercent | range when densities are concidered close |
|
inlinevirtual |
References collectRefinablePoints(), chess::point, and refineGridpoint().
|
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) |
Reimplemented from sgpp::base::HashRefinement.
References sgpp::base::HashRefinement::addElementToCollection(), sgpp::base::HashGridStorage::begin(), sgpp::base::HashGridStorage::end(), sgpp::base::HashRefinement::getIndicator(), sgpp::base::RefinementFunctor::getRefinementsNum(), and chess::point.
Referenced by ~MultipleClassRefinement().
|
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 |
Reimplemented from sgpp::base::HashRefinement.
References chess::b, sgpp::base::HashRefinement::createGridpoint(), chess::dim, sgpp::base::HashGridPoint::get(), sgpp::base::MultipleClassPoint::getBorders(), sgpp::base::MultipleClassPoint::getBorderScore(), sgpp::base::MultipleClassPoint::getDensity(), sgpp::base::MultipleClassPoint::getDominateClass(), sgpp::base::HashGridPoint::getLevel(), sgpp::base::MultipleClassPoint::getNeighbors(), sgpp::base::HashGridStorage::getPoint(), sgpp::base::HashGridStorage::getSequenceNumber(), sgpp::base::Grid::getStorage(), sgpp::base::MultipleClassPoint::getTopClasses(), sgpp::base::HashGridStorage::isContaining(), chess::point, and sgpp::base::HashGridPoint::set().
Referenced by ~MultipleClassRefinement().