Function tskit::bindings::tsk_tree_postorder_from
source · pub unsafe extern "C" fn tsk_tree_postorder_from(
self_: *const tsk_tree_t,
root: tsk_id_t,
nodes: *mut tsk_id_t,
num_nodes: *mut tsk_size_t
) -> c_int
Expand description
@brief Fill an array with the nodes of this tree starting from a particular node.
@rst
As for :c:func:tsk_tree_postorder
but starting the traversal at a particular node
(which will be the last node in the traversal list). The
:ref:virtual root<sec_data_model_tree_roots>
is a valid input for this function
and will be treated like any other tree node. The value -1
is a special case,
in which we visit all nodes reachable from the roots, and equivalent to
calling :c:func:tsk_tree_postorder
.
See :c:func:tsk_tree_postorder
for details the requirements for the nodes
array.
@endrst
@param self A pointer to a tsk_tree_t object.
@param root The root of the subtree to traverse, or -1 to visit all nodes.
@param nodes The tsk_id_t array to store nodes in. See
:c:func:tsk_tree_postorder
for more details.
@param num_nodes A pointer to a tsk_size_t value where we store the number
of nodes in the traversal.
@return 0 on success or a negative value on failure.