/** * @file MaxDistance.cpp * @brief maximum distance measure * @author Erik Rodner * @date 02/19/2008 */ #include #include "vislearning/math/distances/MaxDistance.h" using namespace OBJREC; using namespace std; // refactor-nice.pl: check this substitution // old: using namespace ice; using namespace NICE; MaxDistance::MaxDistance() { } MaxDistance::~MaxDistance() { } double MaxDistance::doCalculate (const NICE::Vector & x, const NICE::Vector & y) const { double dist = 0.0; for ( int i = 0 ; i < (int)x.size() ; i++ ) { double u = x[i]; double v = y[i]; double disttmp= fabs(u-v); if (disttmp>dist) { dist=disttmp; } } return dist; }