1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- /**
- * @file MaxDistance.cpp
- * @brief maximum distance measure
- * @author Erik Rodner
- * @date 02/19/2008
- */
- #include <iostream>
- #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;
- }
|