Struct faiss::FlatCodesDistanceComputer
-
struct FlatCodesDistanceComputer : public faiss::DistanceComputer
Subclassed by faiss::ScalarQuantizer::SQDistanceComputer
Public Functions
-
inline FlatCodesDistanceComputer(const uint8_t *codes, size_t code_size)
-
inline FlatCodesDistanceComputer()
-
inline virtual float operator()(idx_t i) override
compute distance of vector i to current query
-
virtual float distance_to_code(const uint8_t *code) = 0
compute distance of current query to an encoded vector
-
inline virtual ~FlatCodesDistanceComputer()
-
virtual void set_query(const float *x) = 0
called before computing distances. Pointer x should remain valid while operator () is called
-
inline virtual void distances_batch_4(const idx_t idx0, const idx_t idx1, const idx_t idx2, const idx_t idx3, float &dis0, float &dis1, float &dis2, float &dis3)
compute distances of current query to 4 stored vectors. certain DistanceComputer implementations may benefit heavily from this.
Public Members
-
const uint8_t *codes
-
size_t code_size
-
inline FlatCodesDistanceComputer(const uint8_t *codes, size_t code_size)