19 #include "VectorTransform.h"
26 typedef unsigned char uint8_t;
54 virtual void set_typename ()
override;
56 virtual void train (
idx_t n,
const float *x)
override;
58 virtual void add (
idx_t n,
const float *x)
override;
62 const float *x,
idx_t k,
64 idx_t *labels)
const override;
66 virtual void reset()
override;
Randomly rotate a set of vectors.
int bytes_per_vec
nb of 8-bits per encoded vector
std::vector< float > thresholds
thresholds to compare with
bool train_thresholds
whether we train thresholds or use 0
virtual void search(idx_t n, const float *x, idx_t k, float *distances, idx_t *labels) const override
RandomRotationMatrix rrot
optional random rotation
void transfer_thresholds(LinearTransform *vt)
long idx_t
all indices are this type
virtual void reset() override
removes all elements from the database.
virtual void add(idx_t n, const float *x) override
virtual void train(idx_t n, const float *x) override
int nbits
nb of bits per vector
const float * apply_preprocess(idx_t n, const float *x) const
bool rotate_data
whether to apply a random rotation to input
std::vector< uint8_t > codes
encoded dataset