9 #ifndef MKNN_DISTANCE_HPP_
10 #define MKNN_DISTANCE_HPP_
12 #include "../metricknn_cpp.hpp"
17 class DistanceCustomFactory;
84 bool delete_factory_on_distance_release);
125 void save(std::string filename_write);
169 std::unique_ptr<Impl>
pimpl;
192 virtual double evalDistance(
void *object_left,
void *object_right,
193 double current_threshold) = 0;
214 Domain *domain_right) = 0;
Stores parameters in an internal map, which associates a names with its value.
Definition: mknn_params.hpp:21
Abstract class that must be inherited to define a custom distance.
Definition: mknn_distance.hpp:178
Abstract class that must be inherited to define a custom distance.
Definition: mknn_distance.hpp:201
Distance & operator=(const Distance &other)
Assignment operator.
virtual ~Distance()
Default destructor.
DistanceEval newDistanceEval(Domain domain_left, Domain domain_right)
Creates a distance for computing distances between objects of the given domains.
virtual double evalDistance(void *object_left, void *object_right, double current_threshold)=0
The function of a custom distance that computes the distance between two objects. ...
A Index represents the index structure.
Definition: mknn_index.hpp:45
void save(std::string filename_write)
The distance is saved to a file.
static Distance restore(std::string filename_read, DistanceParams &more_parameters)
Loads a distance from a file.
This class computes the distance between two objects from a given Domain.
Definition: mknn_distance_eval.hpp:19
Definition: mevaluation_answers.hpp:18
Distance()
Default constructor.
DistanceParams & getParameters()
Return the parameters used to create the distance.
static Distance newCustom(DistanceCustomFactory *factory, bool delete_factory_on_distance_release)
Creates a new custom function.
The Distance is the object with the definition of the method for comparing objects.
Definition: mknn_distance.hpp:59
virtual DistanceCustomInstance * newInstance(Domain *domain_left, Domain *domain_right)=0
The function of a custom distance that creates a new state.
A domain represents the type of object that are contained in a dataset.
Definition: mknn_domain.hpp:33
std::string getIdPredefinedDistance()
The id of the predefined distance.
static Distance newPredefined(DistanceParams ¶meters)
Creates a new distance for the given parameters.
std::unique_ptr< Impl > pimpl
Internal opaque class.
Definition: mknn_distance.hpp:165