27 #ifndef MPBLOCKS_BTPS_EXAMPLETRAITS_H_
28 #define MPBLOCKS_BTPS_EXAMPLETRAITS_H_
94 #endif // EXAMPLETRAITS_H_
double cumweight
cumulative weight of children
double & CumulativeWeight(NodeRef N)
return the cumulative weight of the subtree, the return type is deduced by the tree template and can ...
uint32_t & Count(NodeRef N)
return the subtree node count
a callable type which implements the primitives required to access fields of a node ...
uint32_t freq
number of times sampled
uint32_t count
count of subtree descendants
this type is not required by the interface, but if you just need a simple node type then this one wil...
NodeRef & LeftChild(NodeRef N)
return the left child of N
Node * NodeRef
some type which stores uniquely identifies nodes, for instance a node pointer or an index into an arr...
NodeRef & Parent(NodeRef N)
you can leave this one off you if you dont need removal
double weight
the weight of this node
NodeRef parent
only needed if we want removal
an example traits structure from which a balanced tree of partial sums may be instantiated ...
double Weight(NodeRef N)
return the weight of this node in particular
NodeRef & RightChild(NodeRef N)
return the right child of N