tacco.utils.dense_distance_matrix

dense_distance_matrix(A, B=None, parallel=True)[source]

Calclulate a dense pairwise euclidean distance matrix of dense inputs. Compared to tacco.tools.cdist() this has a few extra optimizations for 1D-3D data - and only works for dense inputs.

For a sparse version, see sparse_distance_matrix().

Parameters:
  • A – A 2d ndarray.

  • B – A 2d ndarray with the same second dimension as A. If None, use A.

  • parallel – Whether to run the operation in parallel.

Returns:

A ndarray containing the distances.