Recursively finds all ancestor nodes in DAG for node with the given index.
ancestor.find(index, map, n.nodes)
Index of the node currently at.
Matrix of n.edges
-by-2
dimension, where n.edges
is the number of directed edges in DAG. The first column has indices of
nodes that edges directing from, whereas the second column gives the indices
of nodes the corresponding edges directing towards.
Number of nodes in DAG.
Returns a length-n.nodes
vector of binary values for which
1 indicates the corresponding node is an ancestor node and 0 indicates it is not.