Faiss

- Main Page
- Namespaces
- Classes
- Files

- File List

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