| 1028 | return result; |
| 1029 | } |
| 1030 | float |
| 1031 | IVF::CalcDistanceById(const float* query, int64_t id) const { |
| 1032 | if (this->use_reorder_) { |
| 1033 | float dist = 0.0F; |
| 1034 | auto computer = this->reorder_codes_->FactoryComputer(query); |
| 1035 | auto inner_id = this->label_table_->GetIdByLabel(id); |
| 1036 | this->reorder_codes_->Query(&dist, computer, &inner_id, 1); |
| 1037 | return dist; |
| 1038 | } |
| 1039 | auto computer = this->bucket_->FactoryComputer(query); |
| 1040 | auto inner_id = this->label_table_->GetIdByLabel(id); |
| 1041 | auto location = this->get_location(inner_id); |
| 1042 | return this->bucket_->QueryOneById(computer, location.first, location.second); |
| 1043 | } |
| 1044 | |
| 1045 | void |
| 1046 | IVF::GetVectorByInnerId(InnerIdType inner_id, float* data) const { |
no test coverage detected