MetricKnn API
Fast Similarity Search using the Metric Space Approach
mknn_dataset.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_DATASET_HPP_
10 #define MKNN_DATASET_HPP_
11 
12 #include "../metricknn_cpp.hpp"
13 
14 namespace mknn {
15 
16 class DatasetCustom;
17 
23 class Dataset {
24 public:
33  long long getNumObjects();
34 
40  void *getObject(long long pos);
41 
48  void pushObject(void *object);
49 
55  Domain getDomain();
72  void *getCompactVectors();
73 
79  void printObjectsToTextFile(std::string filename_write);
80 
96  void save(std::string filename_write);
97 
104  static Dataset restore(std::string filename_read);
105 
113  Dataset();
117  virtual ~Dataset();
121  Dataset(const Dataset &other);
125  Dataset &operator=(const Dataset &other);
126 
127 protected:
131  class Impl;
135  std::unique_ptr<Impl> pimpl;
136 
137  friend class DatasetLoader;
138  friend class Distance;
139  friend class Index;
140  friend class PredefDistance;
141  friend class Resolver;
142 };
143 
144 }
145 #endif
std::unique_ptr< Impl > pimpl
opaque object
Definition: mknn_dataset.hpp:131
Domain getDomain()
Returns the domain assigned to the dataset.
MetricKnn provides a set of pre-defined distances.
Definition: mknn_predefined_distance.hpp:30
void pushObject(void *object)
Adds an object to a dataset.
void * getCompactVectors()
The objects in the dataset are stored in a single long array.
void printObjectsToTextFile(std::string filename_write)
It saves the objects in a dataset in text format.
A Index represents the index structure.
Definition: mknn_index.hpp:45
Represents a set of objects of any type.
Definition: mknn_dataset.hpp:23
static Dataset restore(std::string filename_read)
Loads a dataset from a file.
long long getNumObjects()
Size of the dataset.
Definition: mevaluation_answers.hpp:18
Different Loaders.
Definition: mknn_dataset_loader.hpp:105
Dataset & operator=(const Dataset &other)
Assignment operator.
void save(std::string filename_write)
The dataset is saved to a file.
Dataset()
Default constructor.
The Distance is the object with the definition of the method for comparing objects.
Definition: mknn_distance.hpp:59
virtual ~Dataset()
Default destructor.
void * getObject(long long pos)
Retrieves the object in position pos in dataset.
A Resolver represents the parameters of a similarity search.
Definition: mknn_resolver.hpp:27
A domain represents the type of object that are contained in a dataset.
Definition: mknn_domain.hpp:33
Powered by Download MetricKnn