MetricKnn API
Fast Similarity Search using the Metric Space Approach
Public Member Functions | Protected Attributes | Friends | List of all members
mknn::DistanceEval Class Reference

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...
 
DistancegetDistance ()
 returns the distance declared for the object. More...
 
DomaingetDomainLeft ()
 returns the domain declared for the object at the left. More...
 
DomaingetDomainRight ()
 returns the domain declared for the object at the right. More...
 
 DistanceEval ()
 Default constructor.
 
virtual ~DistanceEval ()
 Default destructor.
 
 DistanceEval (const DistanceEval &other)
 Copy constructor.
 
DistanceEvaloperator= (const DistanceEval &other)
 Assignment operator.
 

Protected Attributes

std::unique_ptr< Impl > pimpl
 opaque object
 

Friends

class Distance
 

Detailed Description

This class computes the distance between two objects from a given Domain.

Member Function Documentation

double mknn::DistanceEval::eval ( void *  object_left,
void *  object_right 
)

Evaluates the distance between object1 and object2.

Remarks
Note about Multi-threading: Each instance of DistanceEval will be called sequentially by a single thread.
Parameters
object_leftleft object to be evaluated.
object_rightright object to be evaluated.
Returns
a number >= 0 with the distance value between 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).

Remarks
Note about Multi-threading: Each instance of DistanceEval will be called sequentially by a single thread.
Parameters
object_leftleft object to be evaluated.
object_rightright object to be evaluated.
current_thresholdcurrent threshold to perform an early termination.
Returns
a number >= 0 with the distance value between object1 and object2.
Distance& mknn::DistanceEval::getDistance ( )

returns the distance declared for the object.

Returns
the distance declared for the object.
Domain& mknn::DistanceEval::getDomainLeft ( )

returns the domain declared for the object at the left.

Returns
the domain declared for the object at the left.
Domain& mknn::DistanceEval::getDomainRight ( )

returns the domain declared for the object at the right.

Returns
the domain declared for the object at the right.

The documentation for this class was generated from the following file:
Powered by Download MetricKnn