All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Metric

Metric Concept

Metric is a concept modeling distance function fulfilling triangle inequality. That is if m is a metric and x,y,z are some vertices then, m(x,y) + m(y,z) > m(x,z).

VertexType - denotes type of point from considered space i.e. argument of the metric.
DistanceType - denotes type of the distance between points.
Metric need to have fulfill the interface:

    MetricArchetype {
        DistanceType operator()(VertexType,VertexType);
    }

DistanceType and VertexType are provided through the paal::data_structures::MetricTraits class.
We have:

Default value of VertexType is int and the DistanceType is detected automatically.

Metric implementations

Paal provides several metrics implementation. The basic one is paal::data_structures::ArrayMetric which is actually 2 dimensional array. The library contains paal::data_structures::GraphMetric which is the metric adapter for boost graph library.