Sparse Distance#

static const std::unordered_set<raft::distance::DistanceType> raft::sparse::distance::supportedDistance = {raft::distance::DistanceType::L2Expanded, raft::distance::DistanceType::L2Unexpanded, raft::distance::DistanceType::L2SqrtExpanded, raft::distance::DistanceType::L2SqrtUnexpanded, raft::distance::DistanceType::InnerProduct, raft::distance::DistanceType::L1, raft::distance::DistanceType::Canberra, raft::distance::DistanceType::Linf, raft::distance::DistanceType::LpUnexpanded, raft::distance::DistanceType::JaccardExpanded, raft::distance::DistanceType::CosineExpanded, raft::distance::DistanceType::HellingerExpanded, raft::distance::DistanceType::DiceExpanded, raft::distance::DistanceType::CorrelationExpanded, raft::distance::DistanceType::RusselRaoExpanded, raft::distance::DistanceType::HammingUnexpanded, raft::distance::DistanceType::JensenShannon, raft::distance::DistanceType::KLDivergence}#
template<typename value_idx = int, typename value_t = float>
void raft::sparse::distance::pairwiseDistance(value_t *out, detail::distances_config_t<value_idx, value_t> input_config, raft::distance::DistanceType metric, float metric_arg)#

Compute pairwise distances between A and B, using the provided input configuration and distance function.

Template Parameters:
  • value_idx – index type

  • value_t – value type

Parameters:
  • out[out] dense output array (size A.nrows * B.nrows)

  • input_config[in] input argument configuration

  • metric[in] distance metric to use

  • metric_arg[in] metric argument (used for Minkowski distance)