ExecutionEngine.h 1.2 KB
Newer Older
X
Xu Peng 已提交
1 2 3 4 5
/*******************************************************************************
 * Copyright 上海赜睿信息科技有限公司(Zilliz) - All Rights Reserved
 * Unauthorized copying of this file, via any medium is strictly prohibited.
 * Proprietary and confidential.
 ******************************************************************************/
X
Xu Peng 已提交
6 7
#pragma once

8 9
#include "Status.h"

X
Xu Peng 已提交
10
#include <vector>
X
Xu Peng 已提交
11
#include <memory>
X
Xu Peng 已提交
12 13 14 15 16

namespace zilliz {
namespace vecwise {
namespace engine {

17
template <typename Derived>
18
class ExecutionEngine {
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
public:

    Status AddWithIds(const std::vector<float>& vectors,
                              const std::vector<long>& vector_ids);

    Status AddWithIds(long n, const float *xdata, const long *xids);

    size_t Count() const;

    size_t Size() const;

    size_t PhysicalSize() const;

    Status Serialize();

    Status Load();

    Status Merge(const std::string& location);

    Status Search(long n,
                  const float *data,
                  long k,
                  float *distances,
                  long *labels) const;

    std::shared_ptr<Derived> BuildIndex(const std::string&);

    Status Cache();
};

X
Xu Peng 已提交
49 50 51 52

} // namespace engine
} // namespace vecwise
} // namespace zilliz