yat  0.14.5pre
Public Member Functions | List of all members
theplu::yat::statistics::Distance< Derived > Class Template Reference

A convenience class to implement Distance. More...

#include <yat/statistics/Distance.h>

Public Member Functions

template<typename Iterator1 , typename Iterator2 >
double operator() (Iterator1 beg1, Iterator1 end1, Iterator2 beg2) const
 

Detailed Description

template<class Derived>
class theplu::yat::statistics::Distance< Derived >

A convenience class to implement Distance.

This class provides a convenient way to implement a Distance. The Derived class should implement two private functions derived as shown in example below:

class Derived : public Distance<Derived>
{
private:
template <typename Iterator1, typename Iterator2>
double distance (Iterator1 beg1, Iterator1 end1, Iterator2 beg2,
utility::unweighted_iterator_tag) const
{ ... }
template <typename Iterator1, typename Iterator2>
double distance (Iterator1 beg1, Iterator1 end1, Iterator2 beg2,
utility::weighted_iterator_tag) const
{ ... }
};

To fulfill Distance these functions should do no more assumtions than that the Iterator1 and Iterator fulfill

Requirements:

Member Function Documentation

template<class Derived>
template<typename Iterator1 , typename Iterator2 >
double theplu::yat::statistics::Distance< Derived >::operator() ( Iterator1  beg1,
Iterator1  end1,
Iterator2  beg2 
) const
inline

Function determines ranges are weighted or unweighted and calls the appropriate function in Derived.

If both ranges are unweighted function

Derived::distance(beg1, end1, beg2, utility::unweighted_iterator_tag)

and otherwise function

Derived::distance(beg1, end1, beg2, utility::weighted_iterator_tag)

is called

Type Requirements:


The documentation for this class was generated from the following file:

Generated on Tue Sep 26 2017 02:33:30 for yat by  doxygen 1.8.5