Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
/data/users/hoss/faiss/IndexBinaryFromFloat.h
1 /**
2  * Copyright (c) Facebook, Inc. and its affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 // -*- c++ -*-
9 
10 #ifndef FAISS_INDEX_BINARY_FROM_FLOAT_H
11 #define FAISS_INDEX_BINARY_FROM_FLOAT_H
12 
13 #include "IndexBinary.h"
14 
15 
16 namespace faiss {
17 
18 
19 struct Index;
20 
21 /** IndexBinary backed by a float Index.
22  *
23  * Supports adding vertices and searching them.
24  *
25  * All queries are symmetric because there is no distinction between codes and
26  * vectors.
27  */
29  Index *index = nullptr;
30 
31  bool own_fields = false; ///< Whether object owns the index pointer.
32 
34 
35  explicit IndexBinaryFromFloat(Index *index);
36 
38 
39  void add(idx_t n, const uint8_t *x) override;
40 
41  void reset() override;
42 
43  void search(idx_t n, const uint8_t *x, idx_t k,
44  int32_t *distances, idx_t *labels) const override;
45 
46  void train(idx_t n, const uint8_t *x) override;
47 };
48 
49 
50 } // namespace faiss
51 
52 #endif // FAISS_INDEX_BINARY_FROM_FLOAT_H
void add(idx_t n, const uint8_t *x) override
bool own_fields
Whether object owns the index pointer.
Index::idx_t idx_t
all indices are this type
Definition: IndexBinary.h:37
void search(idx_t n, const uint8_t *x, idx_t k, int32_t *distances, idx_t *labels) const override
void reset() override
Removes all elements from the database.
void train(idx_t n, const uint8_t *x) override