Unordered Trees¶
-
class
pybs.unordered_tree.unordered_trees.
UnorderedTree
[source]¶ Class whose elements represents unabeled, unordered rooted trees.
A tree is represented as a multiset of child trees. That is, the internal organization closely resemples the notation \(\tau = [\tau_1^{m_1}, \dots, \tau_k^{m_k}]\) known from the literature.
-
__init__
(arg)[source]¶ Initiate a tree from arguments.
Possible arguments include strings of the format
[[],[]]
, anotherUnorderedTree
and a list/tuple of trees.
-
butcher_product
(other)[source]¶ Return the Butcher product \(self \circ other\)
The Butcher product is formed by adding
other
to the multiset of children of self.
-
F
()[source]¶ Return elementary differential as a string.
The returned string is not really suitable for further calculations.
-
is_binary
()[source]¶ Check if the
UnorderedTree
is a binary tree.
-
is_tall
()[source]¶ Check if the
UnorderedTree
is a tall tree.
-
is_bushy
()[source]¶ Check if the
UnorderedTree
is a bushy tree.
-
get_free_tree
()[source]¶ Return the FreeTree representative of self.
Note that the returned object is not necessarily complete in the sense that it knows about all rooted trees it represents. To make sure the rooted tree is complete, call
the_trees[self.order()].free_trees()
.
-
__eq__
(other)[source]¶ Check if two UnorderedTrees are equal.
Done by checking that other is indeed an Unordered tree, and the test equality as ClonableMultisets.
-
__cmp__
(other)[source]¶ Ordering due to P.Leone (2000) PhD thesis.
This is a total ordering. For most purposes it is just used to define a suitable bijection between \(T\) and \(\mathbb{N}\).
-