A Monoid Annotation Tree is a binary tree whose nodes are each
annotated by values from some monoid. The annotation of an internal node
is computed by applying the operation to the annotations of its children.
The annotation of a leaf node is specified by the user. Every node must
either have two children or be a leaf node.
Each leaf node may also be associated with an arbitrary opaque value
of the user's choosing. This node and value will remain associated.
|
|
|
|
|
_update(self,
node,
sentinel=None)
node must be an internal node |
source code
|
|
|
|
_update_add(self,
node,
sentinel=None)
node must be an internal node |
source code
|
|
|
|
_update_del(self,
node,
sentinel=None)
node must be an internal node |
source code
|
|
|
|
_split_link(self,
node)
Introduce and return a new node (newparent) between node and its
parent |
source code
|
|
|
|
|
|
|
|
|
|
add(self,
new,
walker)
Add a new leaf node at a position determined by walker. |
source code
|
|
|
|
|
|
|
change_annotation(self,
leaf,
newann)
When changing the annotation of a leaf, it is required to use this
method, so that the change may be propagated up through the tree
according to the operation. |
source code
|
|
|
|
|
|
|
|