Belle II Software development
|
Dynamic tree structure with weighted items in each node which are markable through out the tree. More...
#include <WeightedFastHoughTree.h>
Public Types | |
using | Node = typename Super::Node |
Type of the node in the tree. | |
Public Member Functions | |
template<class Ts > | |
void | seed (const Ts &items) |
Take the item set and insert them into the top node of the hough space. | |
template<class AItemInDomainMeasure > | |
std::vector< std::pair< ADomain, std::vector< T > > > | findHeavyLeavesDisjoint (AItemInDomainMeasure &weightItemInDomain, int maxLevel, double minWeight) |
Find all children node at maximum level and add them to the result list. Skip nodes if their weight is below minWeight. | |
template<class AItemInDomainMeasure , class ASkipNodePredicate > | |
std::vector< std::pair< ADomain, std::vector< T > > > | findLeavesDisjoint (AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode) |
Find all children node at maximum level and add them to the result list. Skip nodes if skipNode returns true. | |
template<class AItemInDomainMeasure > | |
std::vector< std::pair< ADomain, std::vector< T > > > | findHeaviestLeafRepeated (AItemInDomainMeasure &weightItemInDomain, int maxLevel, const Weight minWeight=NAN) |
Go through all children until maxLevel is reached and find the heaviest leaves. | |
template<class AItemInDomainMeasure , class ASkipNodePredicate > | |
std::vector< std::pair< ADomain, std::vector< T > > > | findHeaviestLeafRepeated (AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode) |
Go through all children until maxLevel is reached and find the heaviest leaves. | |
template<class AItemInDomainMeasure , class ASkipNodePredicate > | |
std::unique_ptr< std::pair< ADomain, std::vector< T > > > | findHeaviestLeafSingle (AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode) |
Go through all children until the maxLevel is reached and find the leaf with the highest weight. | |
template<class AItemInDomainMeasure , class ASkipNodePredicate > | |
Node * | findHeaviestLeaf (AItemInDomainMeasure &weightItemInDomain, int maxLevel, ASkipNodePredicate &skipNode) |
Go through all children until the maxLevel is reached and find the leaf with the highest weight. | |
template<class AItemInDomainMeasure , class AIsLeafPredicate > | |
void | fillWalk (AItemInDomainMeasure &weightItemInDomain, AIsLeafPredicate &isLeaf) |
Walk through the children and fill them if necessary until isLeaf returns true. | |
template<class ATreeWalker > | |
void | walkHeighWeightFirst (ATreeWalker &walker) |
Walk the tree investigating the heaviest children with priority. | |
void | fell () |
Fell to tree meaning deleting all child nodes from the tree. Keeps the top node. | |
void | raze () |
Like fell but also releases all memory the tree has acquired during long executions. | |
Node & | getTopNode () |
Getter for the top node of the tree. | |
const Node & | getTopNode () const |
Constant getter for the top node of the tree. | |
int | getNNodes () const |
Gets the number of nodes currently contained in the tree Also demonstrates how to walk over the tree. | |
std::map< int, int > | getNNodesByLevel () const |
Gets the number of nodes by level in the tree Also demonstrates how to walk over the tree. | |
template<class AWalker > | |
void | walk (AWalker &walker) |
Forward walk to the top node. | |
template<class AWalker , class APriorityMeasure > | |
void | walk (AWalker &walker, APriorityMeasure &priority) |
Forward walk to the top node. | |
Public Attributes | |
SubPropertiesFactory | m_subPropertiesFactory |
Instance of the properties factory for the sub nodes. | |
Node | m_topNode |
Memory for the top node of the tree. | |
std::deque< typename Node::Children > | m_children |
Central point to provide memory for the child structures. | |
size_t | m_nUsedChildren = 0 |
Last index of used children. | |
Private Types | |
using | Super = WeightedParititioningDynTree< WithSharedMark< T >, ADomain, ADomainDivsion > |
Type of the Tree the partitions using markable items the hough space. | |
using | This = DynTree< AProperties, ASubPropertiesFactory > |
Type of this class. | |
using | Properties = AProperties |
Type of the Properties. | |
using | SubPropertiesFactory = ASubPropertiesFactory |
Type of the factory for the sub node properties. | |
Private Member Functions | |
std::vector< Node > * | createChildren (Node *parentNode) |
Create child nodes for the given parents. | |
std::vector< Node > * | getUnusedChildren () |
Acquire the next unused child node structure, recycling all memory. | |
Private Attributes | |
std::deque< bool > | m_marks |
Memory of the used marks of the items. | |
Dynamic tree structure with weighted items in each node which are markable through out the tree.
Used to build fast hough type algorithms, where objects are allowed to carry weights relative to the hough space part (here called a ADomain) they are contained in. The shared marks allow for iterative extraction of hough peaks such that other areas of the hough space notice that certain element have already been consumed.
Definition at line 49 of file WeightedFastHoughTree.h.
using Node = typename Super::Node |
Type of the node in the tree.
Definition at line 61 of file WeightedFastHoughTree.h.
|
privateinherited |
|
privateinherited |
|
private |
Type of the Tree the partitions using markable items the hough space.
Definition at line 54 of file WeightedFastHoughTree.h.
Create child nodes for the given parents.
Definition at line 284 of file DynTree.h.
|
inline |
Fell to tree meaning deleting all child nodes from the tree. Keeps the top node.
Definition at line 292 of file WeightedFastHoughTree.h.
|
inline |
Walk through the children and fill them if necessary until isLeaf returns true.
Uses the weightItemInDomain to create weights for the items (or decide if an item belongs to a mode or not).
Definition at line 239 of file WeightedFastHoughTree.h.
|
inline |
Go through all children until the maxLevel is reached and find the leaf with the highest weight.
If no node could be found, return a nullptr. A node is skipped if skipNode is returns true for this node.
Definition at line 201 of file WeightedFastHoughTree.h.
|
inline |
Go through all children until maxLevel is reached and find the heaviest leaves.
For this, the single heaviest leaf is found and added to an internal list. The process is repeated until no leaf can be found anymore. A node is skipped if skipNode is returns true for this node.
Definition at line 154 of file WeightedFastHoughTree.h.
|
inline |
Go through all children until maxLevel is reached and find the heaviest leaves.
For this, the single heaviest leaf is found and added to an internal list. The process is repeated until no leaf can be found anymore. A node is skipped if the weight is below minWeight.
Definition at line 135 of file WeightedFastHoughTree.h.
|
inline |
Go through all children until the maxLevel is reached and find the leaf with the highest weight.
If no node could be found, return an empty list, otherwise return a list with just on element. A node is skipped if skipNode is returns true for this node.
Definition at line 178 of file WeightedFastHoughTree.h.
|
inline |
Find all children node at maximum level and add them to the result list. Skip nodes if their weight is below minWeight.
Definition at line 81 of file WeightedFastHoughTree.h.
|
inline |
Find all children node at maximum level and add them to the result list. Skip nodes if skipNode returns true.
Definition at line 94 of file WeightedFastHoughTree.h.
|
inlineinherited |
Gets the number of nodes currently contained in the tree Also demonstrates how to walk over the tree.
Definition at line 248 of file DynTree.h.
|
inlineinherited |
Gets the number of nodes by level in the tree Also demonstrates how to walk over the tree.
Definition at line 264 of file DynTree.h.
|
inlineinherited |
Getter for the top node of the tree.
Definition at line 237 of file DynTree.h.
|
inlineinherited |
|
inlineprivateinherited |
Acquire the next unused child node structure, recycling all memory.
Definition at line 304 of file DynTree.h.
|
inline |
Like fell but also releases all memory the tree has acquired during long executions.
Definition at line 300 of file WeightedFastHoughTree.h.
|
inline |
Take the item set and insert them into the top node of the hough space.
Definition at line 66 of file WeightedFastHoughTree.h.
|
inlineinherited |
Forward walk to the top node.
Definition at line 316 of file DynTree.h.
|
inlineinherited |
|
inline |
Walk the tree investigating the heaviest children with priority.
Clear items that have been marked as used before evaluating the weight.
Definition at line 277 of file WeightedFastHoughTree.h.
|
inherited |
|
private |
Memory of the used marks of the items.
Definition at line 309 of file WeightedFastHoughTree.h.
|
inherited |
|
inherited |
|
inherited |