MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / quantize_qg_batch

Function quantize_qg_batch

include/rabitqlib/quantization/rabitq.hpp:85–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84template <typename T>
85static inline void quantize_qg_batch(
86 const T* data,
87 const T* centroid,
88 size_t num,
89 size_t padded_dim,
90 char* batch_data,
91 MetricType metric_type = METRIC_L2
92) {
93 std::vector<T> f_error(fastscan::kBatchSize); // we dont need this factor for qg
94 QGBatchDataMap<T> cur_batch(batch_data, padded_dim);
95
96 rabitq_impl::one_bit::one_bit_batch_code<T>(
97 data,
98 centroid,
99 num,
100 padded_dim,
101 cur_batch.bin_code(),
102 cur_batch.f_add(),
103 cur_batch.f_rescale(),
104 f_error.data(),
105 metric_type
106 );
107}
108
109template <typename T>
110static inline void quantize_qg_batch(

Callers 1

update_qgMethod · 0.85

Calls 4

bin_codeMethod · 0.45
f_addMethod · 0.45
f_rescaleMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected