MetricKnn API
Fast Similarity Search using the Metric Space Approach
mknn_index.hpp
1 /*
2  * Copyright (C) 2012-2015, Juan Manuel Barrios <juanmanuel@barrios.cl>
3  * All rights reserved.
4  *
5  * This file is part of MetricKnn.
6  * MetricKnn is made available under the terms of the BSD 2-Clause License.
7  */
8 
9 #ifndef MKNN_INDEX_HPP_
10 #define MKNN_INDEX_HPP_
11 
12 #include "../metricknn_cpp.hpp"
13 
14 namespace mknn {
15 
16 class Resolver;
17 
45 class Index {
46 public:
47 
59  static Index newPredefined(IndexParams &parameters, Dataset &search_dataset,
60  Distance &distance);
61 
77 
82  std::string getIdPredefinedIndex();
83 
93  void save(std::string filename_write);
94 
112  static Index restore(std::string filename_read, Dataset &search_dataset,
113  Distance &distance, IndexParams &more_parameters);
114 
122  Resolver newResolver(ResolverParams &parameters_resolver);
123 
127  Index();
131  virtual ~Index();
135  Index(const Index &other);
139  Index &operator=(const Index &other);
140 
141 protected:
145  class Impl;
149  std::unique_ptr<Impl> pimpl;
150 };
151 
152 }
153 
154 #endif
Resolver newResolver(ResolverParams &parameters_resolver)
Configures a new similarity search using the given index.
IndexParams & getParameters()
Returns the parameters used to create or load the index.
Stores parameters in an internal map, which associates a names with its value.
Definition: mknn_params.hpp:223
Index & operator=(const Index &other)
Assignment operator.
static Index restore(std::string filename_read, Dataset &search_dataset, Distance &distance, IndexParams &more_parameters)
Loads an index from a file.
std::string getIdPredefinedIndex()
returns the id of the predefined index.
std::unique_ptr< Impl > pimpl
opaque object
Definition: mknn_index.hpp:145
static Index newPredefined(IndexParams &parameters, Dataset &search_dataset, Distance &distance)
Instantiates a new index identified by the given parameters.
Distance & getDistance()
Returns the distance used to create or load the index.
Dataset & getSearchDataset()
Returns the dataset used to create or load the index.
A Index represents the index structure.
Definition: mknn_index.hpp:45
Represents a set of objects of any type.
Definition: mknn_dataset.hpp:23
Stores parameters in an internal map, which associates a names with its value.
Definition: mknn_params.hpp:417
Definition: mevaluation_answers.hpp:18
virtual ~Index()
Default destructor.
The Distance is the object with the definition of the method for comparing objects.
Definition: mknn_distance.hpp:59
void save(std::string filename_write)
Saves the built index to a file.
Index()
Default constructor.
A Resolver represents the parameters of a similarity search.
Definition: mknn_resolver.hpp:27
Powered by Download MetricKnn