Ball Cover

View as Markdown

Source header: cuvs/neighbors/ball_cover.hpp

Types

neighbors::ball_cover::index

Stores raw index data points, sampled landmarks, the 1-nns of index points

to their closest landmarks, and the ball radii of each landmark. This class is intended to be constructed once and reused across subsequent queries.

1template <typename idx_t, typename value_t>
2struct index : cuvs::neighbors::index {
3 raft::resources const& handle;
4 int64_t m;
5 int64_t n;
6 int64_t n_landmarks;
7 raft::device_matrix_view<const float, idx_t, raft::row_major> X;
8 cuvs::distance::DistanceType metric;
9};

Fields

NameTypeDescription
handleraft::resources const&
mint64_t
nint64_t
n_landmarksint64_t
Xraft::device_matrix_view<const float, idx_t, raft::row_major>
metriccuvs::distance::DistanceType

Random Ball Cover algorithm

neighbors::ball_cover::build

Builds and populates a previously unbuilt cuvs::neighbors::ball_cover::index

1void build(raft::resources const& handle, index<int64_t, float>& index);

Usage example:

Parameters

NameDirectionTypeDescription
handleinraft::resources const&library resource management handle
indexinoutindex<int64_t, float>&an empty (and not previous built) instance of cuvs::neighbors::ball_cover::index

Returns

void