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 (as skbio.tree.TreeNode.lca computes).

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_engine option. 'fast' is chosen per tree: see the Notes of BPTree.

Returns:
array of intp

The position of the lowest common ancestor of each pair, in the broadcast shape of i and j. Its array backend and device are those of i and j (see close_batch).

See also

lca