Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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 */
28 struct IndexBinaryFromFloat : IndexBinary {
29 Index *index = nullptr;
30
31 bool own_fields = false; ///< Whether object owns the index pointer.
32
33 IndexBinaryFromFloat();
34
35 explicit IndexBinaryFromFloat(Index *index);
36
37 ~IndexBinaryFromFloat();
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
faiss::IndexBinaryFromFloat::add
void add(idx_t n, const uint8_t *x) override
Definition: IndexBinaryFromFloat.cpp:34
faiss::IndexBinaryFromFloat::own_fields
bool own_fields
Whether object owns the index pointer.
Definition: IndexBinaryFromFloat.h:31
faiss::IndexBinary::idx_t
Index::idx_t idx_t
all indices are this type
Definition: IndexBinary.h:37
faiss::IndexBinaryFromFloat::search
void search(idx_t n, const uint8_t *x, idx_t k, int32_t *distances, idx_t *labels) const override
Definition: IndexBinaryFromFloat.cpp:52
faiss::IndexBinaryFromFloat
Definition: IndexBinaryFromFloat.h:28
faiss::IndexBinaryFromFloat::reset
void reset() override
Removes all elements from the database.
Definition: IndexBinaryFromFloat.cpp:47
faiss::IndexBinary
Definition: IndexBinary.h:36
faiss::Index
Definition: Index.h:61
faiss::IndexBinaryFromFloat::train
void train(idx_t n, const uint8_t *x) override
Definition: IndexBinaryFromFloat.cpp:69