knncolle_hnsw
knncolle bindings for HNSW
Loading...
Searching...
No Matches
load_hnsw_prebuilt.hpp
Go to the documentation of this file.
1#ifndef KNNCOLLE_HNSW_LOAD_PREBUILT_HPP
2#define KNNCOLLE_HNSW_LOAD_PREBUILT_HPP
3
4#include "utils.hpp"
5#include "Hnsw.hpp"
6
7#include <cstddef>
8#include <stdexcept>
9#include <string>
10
11#include "knncolle/knncolle.hpp"
12
18namespace knncolle_hnsw {
19
31
39inline HnswPrebuiltTypes load_hnsw_prebuilt_types(const std::string& prefix) {
41 knncolle::quick_load(prefix + "type", &type, 1);
42 HnswPrebuiltTypes config;
43 config.data = type;
44 return config;
45}
46
72template<typename Index_, typename Data_, typename Distance_, typename HnswData_>
73auto load_hnsw_prebuilt(const std::string& prefix) {
74 return new HnswPrebuilt<Index_, Data_, Distance_, HnswData_>(prefix);
75}
76
77}
78
79#endif
knncolle bindings for HNSW search.
Definition distances.hpp:13
auto load_hnsw_prebuilt(const std::string &prefix)
Definition load_hnsw_prebuilt.hpp:73
HnswPrebuiltTypes load_hnsw_prebuilt_types(const std::string &prefix)
Definition load_hnsw_prebuilt.hpp:39
void quick_load(const std::string &path, Input_ *const contents, const Length_ length)
Template types of a saved HNSW index.
Definition load_hnsw_prebuilt.hpp:25
knncolle::NumericType data
Definition load_hnsw_prebuilt.hpp:29