get_next_subtree {autoharp}R Documentation

Generate the next sub-tree.

Description

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

Usage

get_next_subtree(obj, char_arr)

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.

Value

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

See Also

generate_all_subtrees

Examples

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))


[Package autoharp version 0.0.10 Index]