Herwig
7.2.1
|
binary_tree represents a binary tree with the ability to `cascade' visitor objects down the tree More...
#include <binary_tree.h>
Classes | |
class | const_iterator |
const_iterator More... | |
struct | istream_generator |
generator reading binary tree from istream More... | |
class | iterator |
iterator More... | |
struct | ostream_visitor |
forward visitor writing out the tree to given ostream More... | |
Public Types | |
type definitions | |
typedef Value | value_type |
define the object type | |
Public Member Functions | |
bool | empty () const |
return true, if this node is empty | |
void | clear () |
clear this node | |
std::pair< iterator, iterator > | split (std::pair< value_type, value_type > children) |
split this node | |
template<class Selector > | |
iterator | select (const Selector &selector) |
select using a selector | |
template<class Selector , unsigned long bits> | |
void | subtree_hash (const Selector &selector, bit_container< bits > &bhash) |
generate a hash value for the sub-tree selected by the given selector object | |
template<class Accessor , class BinaryOp > | |
BinaryOp::result_type | accumulate (const Accessor &acc, BinaryOp binary_op) const |
accumulate values using a binary function and accessor object | |
template<class Selector , class Accessor , class BinaryOp > | |
BinaryOp::result_type | accumulate (const Selector &selector, const Accessor &acc, BinaryOp binary_op) const |
accumulate values only from branches matching a Selector | |
template<class Accessor , class BinaryOp > | |
BinaryOp::result_type | tree_accumulate (const Accessor &acc, BinaryOp binary_op) |
accumulate values using a binary function and accessor object, storing intermediate values in nodes | |
template<class Selector , class Accessor , class BinaryOp > | |
BinaryOp::result_type | tree_accumulate (const Selector &selector, const Accessor &acc, BinaryOp binary_op) |
accumulate values only from branches matching a Selector | |
template<class Visitor > | |
void | cascade (Visitor visitor) const |
forward propagate a visitor to all children nodes | |
template<class Generator > | |
void | generate (Generator generator) |
succesively split using a generator | |
constructors | |
binary_tree () | |
default constructor | |
binary_tree (const value_type &thevalue, binary_tree *theparent=0) | |
construct giving key/cell and parent | |
binary_tree (const binary_tree &x) | |
binary_tree has a strict ownership; on copying binary trees ownership is transferred | |
binary_tree & | operator= (const binary_tree &x) |
binary_tree has a strict ownership; on copying binary trees ownership is transferred | |
Public member access | |
value_type & | value () |
return the value held by this node | |
const value_type & | value () const |
return the value held by this node | |
bool | root () const |
return true, if this is the root node | |
bool | leaf () const |
return true, if this node has got children | |
put and get from streams | |
template<class OStream > | |
void | put (OStream &os) const |
put to ostream | |
template<class IStream > | |
void | get (IStream &is) |
get from istream | |
Private Member Functions | |
template<class Selector , unsigned long bits> | |
void | do_subtree_hash (const Selector &selector, bit_container< bits > ¤t, unsigned long &position, bool selected=true) const |
calculate hash value | |
private member access | |
binary_tree & | parent () |
return the parent of this node | |
const binary_tree & | parent () const |
return the parent of this node | |
binary_tree & | left_child () |
return the left child of this node | |
const binary_tree & | left_child () const |
return the left child of this node | |
binary_tree & | right_child () |
return the right child of this node | |
const binary_tree & | right_child () const |
return the right child of this node | |
Private Attributes | |
binary_tree * | parent_ |
the parent of this node | |
std::unique_ptr< value_type > | value_ |
the cell held by this node | |
std::pair< std::unique_ptr< binary_tree >, std::unique_ptr< binary_tree > > | children_ |
the children of this node | |
standard-conforming leaf iterators | |
std::pair< binary_tree *, binary_tree * > | neighbours_ |
the left and right neighbours of this node | |
iterator | begin () |
return begin iterator | |
iterator | end () |
return end iterator | |
iterator | global_begin () |
return global begin iterator | |
iterator | global_end () |
return global end iterator | |
const_iterator | begin () const |
return begin const_iterator | |
const_iterator | end () const |
return end const_iterator | |
const_iterator | global_begin () const |
return global begin iterator | |
const_iterator | global_end () const |
return global end iterator | |
void | left_neighbour (binary_tree *n) |
set the left neighbour | |
void | right_neighbour (binary_tree *n) |
set the right neighbour | |
binary_tree * | left_neighbour () const |
get the left neighbour | |
binary_tree * | right_neighbour () const |
get the right neighbour | |
binary_tree * | left_most () |
return the left-most leaf | |
binary_tree * | right_most () |
return the right-most leaf | |
const binary_tree * | left_most () const |
return the left-most leaf | |
const binary_tree * | right_most () const |
return the right-most leaf | |
binary_tree represents a binary tree with the ability to `cascade' visitor objects down the tree
Definition at line 21 of file binary_tree.h.