TreeOutput S

tree.spad line 494 [edit on github]

This package implements new output for trees. Output depends on two paramenters, maximal depth and maximal number of leaves. Maximal depth can be queried using outputDepth() and set to d using outputDepth(d). Similarly maximal number of leaves can be queried using outputNofLeaves() and set to n using outputNofLeaves(n). Default depth is 2 and default number of leaves is 1000. The trees are output until reaching maximal depth d. Leaves are depicted by <v> while the other nodes of depth d list the labels of their children: v-[v1 v2 … vk]. Note further, that the tree grows from left to right and for the edges left to right is depicted from top to bottom. Also, maximal number of leaves that are output is restriced by outputNofLeaves().

outputDepth: () -> NonNegativeInteger

outputDepth() gives the depth until which a tree is depicted.

outputDepth: NonNegativeInteger -> NonNegativeInteger

outputDepth(d) sets the depth until which a tree is depicted to d. It overwrites the default value 2.

outputNofLeaves: () -> NonNegativeInteger

outputNofLeaves() gives the maximal number of leaves, up to then a tree is depicted.

outputNofLeaves: NonNegativeInteger -> NonNegativeInteger

outputNofLeaves(d) sets internal nofLeaves up to then a tree is depicted. It overwrites the default value 1000.

to_output: Tree S -> OutputForm

to_output(t) convert tree t to OutputForm.