|
MetricKnn API
Fast Similarity Search using the Metric Space Approach
|
This class computes the distance between two objects from a given Domain. More...
#include <mknn_distance_eval.hpp>
Public Member Functions | |
| double | eval (void *object_left, void *object_right) |
Evaluates the distance between object1 and object2. More... | |
| double | evalTh (void *object_left, void *object_right, double current_threshold) |
Evaluates the distance between object1 and object2. More... | |
| Distance & | getDistance () |
| returns the distance declared for the object. More... | |
| Domain & | getDomainLeft () |
| returns the domain declared for the object at the left. More... | |
| Domain & | getDomainRight () |
| returns the domain declared for the object at the right. More... | |
| DistanceEval () | |
| Default constructor. | |
| virtual | ~DistanceEval () |
| Default destructor. | |
| DistanceEval (const DistanceEval &other) | |
| Copy constructor. | |
| DistanceEval & | operator= (const DistanceEval &other) |
| Assignment operator. | |
Protected Attributes | |
| std::unique_ptr< Impl > | pimpl |
| opaque object | |
Friends | |
| class | Distance |
This class computes the distance between two objects from a given Domain.
| double mknn::DistanceEval::eval | ( | void * | object_left, |
| void * | object_right | ||
| ) |
Evaluates the distance between object1 and object2.
| object_left | left object to be evaluated. |
| object_right | right object to be evaluated. |
object1 and object2. | double mknn::DistanceEval::evalTh | ( | void * | object_left, |
| void * | object_right, | ||
| double | current_threshold | ||
| ) |
Evaluates the distance between object1 and object2.
The parameter current_threshold can be used to save some computation: if during the computation it is known that the value of the distance will surpass current_threshold, the computation is terminated and return some value greater than current_threshold. Note that this can only be fulfilled by distances whose computation produces increasing partial results (as the euclidean distance).
| object_left | left object to be evaluated. |
| object_right | right object to be evaluated. |
| current_threshold | current threshold to perform an early termination. |
object1 and object2. | Distance& mknn::DistanceEval::getDistance | ( | ) |
returns the distance declared for the object.
| Domain& mknn::DistanceEval::getDomainLeft | ( | ) |
returns the domain declared for the object at the left.
| Domain& mknn::DistanceEval::getDomainRight | ( | ) |
returns the domain declared for the object at the right.
1.8.9.1