BCUT directive

Cuts a tree at a defined node, discarding the nodes and information below it.


Option

RENUMBER = string
Whether or not to renumber the nodes of the tree (yes, no); default no


Parameters

TREE = trees
Trees to be cut

NODE = scalars
Node at which to cut each tree

NEWTREE = trees
New trees with the information cut; if unspecified, the new tree replaces the original tree

CUTTREE = trees
Tree formed from the branches cut from the original tree

OLDNODES = variates
Mapping from old nodes to node numbers in a renumbered new tree (as positive numbers) or to nodes in the CUTTREE (as negative numbers)

NEWNODES = variates
Mapping from new node numbers in a renumbered tree to the original nodes

CUTNODES = variates
Mapping from node numbers in the CUTTREE tree to the original nodes


Description

BCUT provides the basic tree utility of removing an unwanted branch, which is used for example by the BPRUNE procedure. Other tree utilities are described in the description of the TREE directive (which declares and initializes a tree).

   The tree to be cut is specified by the TREE parameter, and the NODE parameter indicates the node at which the cut is to be made. The NEWTREE parameter can supply the identifier for the new tree (after removing all the nodes below NODE); if this is not specified, the new tree replaces the original tree. The subtree below NODE can also be saved (as a tree in its own right, with NODE as the root) using the CUTTREE parameter.

   The OLDNODES parameter can save a variate containing a mapping from the old nodes to the new nodes. If the node is a member of the new tree the variate contains the number of that node in the NEWTREE, while if it is one of the nodes that are deleted the variate contains -1 multiplied by its number in the CUTTREE. As far as OLDNODES is concerned NODE is regarded as a member of the NEWTREE.

   The NEWNODES parameter can save a variate containing the converse mapping from the NEWTREE to the original tree. There is an element for each new node, containing the number of the equivalent node in the original tree. Similarly, the CUTNODES parameter can save a mapping from the CUTTREE to the original tree.

 

Option: RENUMBER.

Parameters: TREE, NODE, NEWTREE, CUTTREE, OLDNODES, NEWNODES, CUTNODES.