Darwin Help

Back to Index

AllRootedTrees

Function AllRootedTrees - Returns all root variants from a tree

Calling Sequence  AllRootedTrees(tree)
Parameters
NameTypeDescription

tree Treethe tree structure with arbitrary root position
Return Type  set(Tree)
Synopsis Returns all root variants from a tree, including the input tree itself.
Examples
> t := Tree(Tree(Leaf(A,15),5,Leaf(B,15)),0,Tree(Leaf(C,15),11,Leaf(D,15)));
t := Tree(Tree(Leaf(A,15),5,Leaf(B,15)),0,Tree(Leaf(C,15),11,Leaf(D,15)))
> sAllRootVariants := AllRootedTrees(t);
sAllRootVariants := {Tree(Leaf(A,5),0,Tree(Leaf(B,15),5,Tree(Leaf(C,25),21,Leaf(
D,25)),100)),Tree(Leaf(C,2),0,Tree(Tree(Leaf(A,28),18,Leaf(B,28)),2,Leaf(D,6),10
0)),Tree(Tree(Leaf(A,15),5,Leaf(B,15)),0,Tree(Leaf(C,15),11,Leaf(D,15))),Tree(Tr
ee(Leaf(A,15),5,Tree(Leaf(C,25),21,Leaf(D,25)),100),0,Leaf(B,5)),Tree(Tree(Tree(
Leaf(A,28),18,Leaf(B,28)),2,Leaf(C,6),100),0,Leaf(D,2))}




See also AllTernaryRoots,   RotateTree,   Tree