Learn R Programming

autoharp (version 0.0.13)

get_next_subtree: Generate the next sub-tree.

Description

This generates the next sub-tree in the enumeration list.

Usage

get_next_subtree(obj, char_arr)

Value

A vector of 1's and 0's, which denotes the next sub-tree in the list.

Arguments

obj

An object of class TreeHarp.

char_arr

A vector of 1's and 0's indicating which nodes to keep. The vector should have length equal to the number of nodes in obj.

Details

Need to reference the paper. This generates the next sub-tree, rooted at the root node of this tree. It will generate singletons on it's own. It has to be used within a loop to do that.

See Also

generate_all_subtrees

Examples

Run this code
th1 <- TreeHarp(list(a=c(2,3), b=NULL, c=NULL))
get_next_subtree(th1, c(1,0,0))
get_next_subtree(th1, c(1,1,0))

Run the code above in your browser using DataLab