yat
0.11.3pre
|
Calculates the Euclidean distance between two points given by elements of ranges. More...
#include <yat/statistics/EuclideanDistance.h>
Public Member Functions | |
template<typename ForwardIterator1 , typename ForwardIterator2 > | |
double | operator() (ForwardIterator1 beg1, ForwardIterator1 end1, ForwardIterator2 beg2) const |
Calculates the Euclidean distance between elements of two ranges. | |
Calculates the Euclidean distance between two points given by elements of ranges.
This class is modelling the concept Distance.
|
inline |
Calculates the Euclidean distance between elements of two ranges.
If elements of both ranges are unweighted the distance is calculated as , where and are elements of the first and second range, respectively.
If elements of one or both of ranges have weights the distance is calculated as , where is the number of elements in the two ranges and and are weights for the elements of the first and the second range, respectively. If the elements of one of the two ranges are unweighted, the weights for these elements are set to unity.