skbio.tree.BPTree.lca_batch#
- BPTree.lca_batch(i, j, engine=None)[source]#
Lowest common ancestor of each pair of nodes in a batch.
The batch counterpart of
lca: one independent query per pair(i[k], j[k]), computed by the selected engine. This is not the lowest common ancestor of a set of nodes (asskbio.tree.TreeNode.lcacomputes).- Parameters:
- i, jarray-like of int
Node positions of each pair, broadcast against each other. As for
lca, either parenthesis of a node names it and the order within a pair does not matter.- engine{‘cython’, ‘numba’, ‘fast’}, optional
The compute engine. Defaults to the global
compute_engineoption.'fast'is chosen per tree: see the Notes ofBPTree.
- Returns:
- array of intp
The position of the lowest common ancestor of each pair, in the broadcast shape of
iandj. Its array backend and device are those ofiandj(seeclose_batch).
See also