| 22 | |
| 23 | namespace py = pybind11; |
| 24 | |
| 25 | namespace rabitqlib::python_bindings { |
| 26 | |
| 27 | class SymqgIndex { |
| 28 | public: |
| 29 | SymqgIndex( |
| 30 | size_t dim, |
| 31 | size_t max_degree, |
| 32 | const std::string& metric = "l2", |
| 33 | size_t quantization_bits = 0 |
| 34 | ) |
| 35 | : dim_(dim) |
| 36 | , max_degree_(max_degree) |
| 37 | , metric_(metric_from_string(metric)) |
| 38 | , quantization_bits_(quantization_bits) { |
| 39 | if (max_degree == 0 || max_degree % rabitqlib::fastscan::kBatchSize != 0) { |
| 40 | throw std::invalid_argument("max_degree must be a positive multiple of 32"); |
| 41 | } |