Filtering#

All nearest neighbors search methods support filtering. Filtering is a method to reduce the number of candidates that are considered for the nearest neighbors search.

#include <cuvs/neighbors/common.hpp>

namespace cuvs::neighbors

enum class FilterType#

Values:

enumerator None#
enumerator Bitmap#
enumerator Bitset#
struct base_filter#
#include <common.hpp>

Subclassed by cuvs::neighbors::filtering::bitmap_filter< bitmap_t, index_t >, cuvs::neighbors::filtering::bitset_filter< bitset_t, index_t >, cuvs::neighbors::filtering::none_sample_filter

struct none_sample_filter : public cuvs::neighbors::filtering::base_filter#
#include <common.hpp>
template<typename index_t, typename filter_t>
struct ivf_to_sample_filter#
#include <common.hpp>

Filter used to convert the cluster index and sample index of an IVF search into a sample index. This can be used as an intermediate filter.

Template Parameters:
  • index_t – Indexing type

  • filter_t

Public Functions

inline _RAFT_HOST_DEVICE bool operator() (const uint32_t query_ix, const uint32_t cluster_ix, const uint32_t sample_ix) const

If the original filter takes three arguments, then don’t modify the arguments. If the original filter takes two arguments, then we are using inds_ptr_ to obtain the sample index.

template<typename bitmap_t, typename index_t>
struct bitmap_filter : public cuvs::neighbors::filtering::base_filter#
#include <common.hpp>

Filter an index with a bitmap.

Template Parameters:
  • bitmap_t – Data type of the bitmap

  • index_t – Indexing type

template<typename bitset_t, typename index_t>
struct bitset_filter : public cuvs::neighbors::filtering::base_filter#
#include <common.hpp>

Filter an index with a bitset.

Template Parameters:
  • bitset_t – Data type of the bitset

  • index_t – Indexing type