/root/doris/contrib/faiss/faiss/clone_index.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) Meta Platforms, Inc. and 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 | | // I/O code for indexes |
11 | | |
12 | | #pragma once |
13 | | |
14 | | namespace faiss { |
15 | | |
16 | | struct Index; |
17 | | struct IndexIVF; |
18 | | struct VectorTransform; |
19 | | struct Quantizer; |
20 | | struct IndexBinary; |
21 | | |
22 | | /* cloning functions */ |
23 | | Index* clone_index(const Index*); |
24 | | |
25 | | /** Cloner class, useful to override classes with other cloning |
26 | | * functions. The cloning function above just calls |
27 | | * Cloner::clone_Index. */ |
28 | | struct Cloner { |
29 | | virtual VectorTransform* clone_VectorTransform(const VectorTransform*); |
30 | | virtual Index* clone_Index(const Index*); |
31 | | virtual IndexIVF* clone_IndexIVF(const IndexIVF*); |
32 | 0 | virtual ~Cloner() {} |
33 | | }; |
34 | | |
35 | | Quantizer* clone_Quantizer(const Quantizer* quant); |
36 | | |
37 | | IndexBinary* clone_binary_index(const IndexBinary* index); |
38 | | |
39 | | } // namespace faiss |