| 206 | |
| 207 | template <int kEmbeddingDim> |
| 208 | void InvertedFile<kEmbeddingDim>::AddEntry(const int image_id, |
| 209 | typename DescType::Index feature_idx, |
| 210 | const DescType& descriptor, |
| 211 | const GeomType& geometry) { |
| 212 | THROW_CHECK_GE(image_id, 0); |
| 213 | THROW_CHECK_EQ(descriptor.size(), kEmbeddingDim); |
| 214 | EntryType entry; |
| 215 | entry.image_id = image_id; |
| 216 | entry.feature_idx = feature_idx; |
| 217 | entry.geometry = geometry; |
| 218 | ConvertToBinaryDescriptor(descriptor, &entry.descriptor); |
| 219 | entries_.push_back(entry); |
| 220 | status_ &= ~kEntriesSorted; |
| 221 | } |
| 222 | |
| 223 | template <int kEmbeddingDim> |
| 224 | void InvertedFile<kEmbeddingDim>::SortEntries() { |