Function tskit::bindings::tsk_tree_get_total_branch_length
source · pub unsafe extern "C" fn tsk_tree_get_total_branch_length(
self_: *const tsk_tree_t,
u: tsk_id_t,
ret_tbl: *mut f64
) -> c_int
Expand description
@brief Computes the sum of the lengths of all branches reachable from
the specified node, or from all roots if u=TSK_NULL
.
@rst
Return the total branch length in a particular subtree or of the
entire tree. If the specified node is :c:macro:TSK_NULL
(or the
:ref:virtual root<sec_data_model_tree_roots>
)
the sum of the lengths of all branches reachable from roots
is returned. Branch length is defined as difference between the time
of a node and its parent. The branch length of a root is zero.
Note that if the specified node is internal its branch length is not* included, so that, e.g., the total branch length of a leaf node is zero. @endrst
@param self A pointer to a tsk_tree_t object.
@param u The root of the subtree of interest, or TSK_NULL
to return the
total branch length of the tree.
@param ret_tbl A double pointer to store the returned total branch length.
@return 0 on success or a negative value on failure.