Dynamic tree structure with weighted items in each node which are markable through out the tree.
More...
|
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.
|
|
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.
|
|
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.
|
|
std::map< int, int > | getNNodesByLevel () const |
| Gets the number of nodes by level in the tree Also demonstrates how to walk over the tree.
|
|
void | walk (AWalker &walker) |
| Forward walk to the top node.
|
|
void | walk (AWalker &walker, APriorityMeasure &priority) |
| Forward walk to the top node.
|
|
void | walk (AWalker &walker) |
| Forward walk to the top node.
|
|
void | walk (AWalker &walker, APriorityMeasure &priority) |
| Forward walk to the top node.
|
|
template<class T, class ADomain, class ADomainDivsion>
class Belle2::TrackFindingCDC::WeightedFastHoughTree< T, ADomain, ADomainDivsion >
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.
template<class T, class ADomain, class ADomainDivsion>
template<class AItemInDomainMeasure, class ASkipNodePredicate>
std::unique_ptr< std::pair< ADomain, std::vector< T > > > findHeaviestLeafSingle |
( |
AItemInDomainMeasure & | weightItemInDomain, |
|
|
int | maxLevel, |
|
|
ASkipNodePredicate & | skipNode ) |
|
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.
181 {
182 using Result = std::pair<ADomain, std::vector<T> >;
183 std::unique_ptr<Result> found = nullptr;
184 Node* node = findHeaviestLeaf(weightItemInDomain, maxLevel, skipNode);
185 if (node) {
186 const ADomain* domain = node;
187 found.reset(new Result(*domain, std::vector<T>(node->begin(), node->end())));
188 for (WithSharedMark<T>& markableItem : *node) {
189 markableItem.mark();
190 }
191 }
192 return found;
193 }