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