Structural Bioinformatics Library
Template C++ / Python API for developping structural bioinformatics applications.
T_Earth_mover_distance< VerticesAccessor, DistanceFunctor > Class Template Reference

Earth mover distance algorithm using lp_solve software for solving linear program problems. More...

#include <Earth_mover_distance.hpp>

Detailed Description

template<class VerticesAccessor, class DistanceFunctor = T_EMD_distance_default<VerticesAccessor>>
class SBL::CADS::T_Earth_mover_distance< VerticesAccessor, DistanceFunctor >

Earth mover distance algorithm using lp_solve software for solving linear program problems.

It is designed as a generic functor implementing the earth mover distance algorithm between two data structures. It is able to handle any type of data structure through the parameter VerticesAccessor that provides the base methods for traversing the set of points of the source and the demand. The distance between points of the source and the demand is also editable and is provided as a template parameter.

Template Parameters
VerticesAccessorBase data structure defining the types and accessors related to the input data structures that are required by this algorithm. See classes SBL::CADS::T_Earth_mover_distance_vertices_accessor_vector and SBL::CADS::T_Earth_mover_distance_vertices_accessor_graph for two examples of use, one where the input data structures are simple containers of weighted points, and the other one where the input data structures are graphs connecting those weighted points.
DistanceFunctorFunctor defining the number type used for representing the distance and returning a distance between two input points. By default, the algorithm is instantiated with the class T_EMD_distance_default which returns a null distance for any pair of points.