This commit is contained in:
William DURAND 2012-01-11 00:36:31 +01:00
parent 38ca00ee57
commit f6fe37d72e
2 changed files with 63 additions and 62 deletions

View File

@ -1,5 +1,5 @@
#ifndef __EUCLIDIAN_HPP__
#define __EUCLIDIAN_HPP__
#ifndef EUCLIDIAN_HPP
#define EUCLIDIAN_HPP
#include <math.h>
#include <vector>
@ -12,82 +12,82 @@
*/
class Euclidean
{
public:
/**
* Constructor
*
* @param const int x Coordinate X
* @param const int y Coordinate Y
*/
Euclidean(const int x, const int y) : _x(x), _y(y) {}
public:
/**
* Constructor
*
* @param const int x Coordinate X
* @param const int y Coordinate Y
*/
Euclidean(const int x, const int y) : _x(x), _y(y) {}
/**
* @param const int x Coordinate X
*/
void setX(const int x) { _x = x; }
/**
* @param const int x Coordinate X
*/
void setX(const int x) { _x = x; }
/**
* @return const int
*/
int getX() const { return _x; }
/**
* @return const int
*/
int getX() const { return _x; }
/**
* @param const int y Coordinate Y
*/
void setY(const int y) { _y = y; }
/**
* @param const int y Coordinate Y
*/
void setY(const int y) { _y = y; }
/**
* @return const int
*/
int getY() const { return _y; }
/**
* @return const int
*/
int getY() const { return _y; }
/**
* @param const double distance A distance.
*/
void setDistance(const double distance) { _distance = distance; }
/**
* @param const double distance A distance.
*/
void setDistance(const double distance) { _distance = distance; }
/**
* @return const double
*/
double getDistance() const { return _distance; }
/**
* @return const double
*/
double getDistance() const { return _distance; }
/**
* @param Euclidean & nearest
*/
void setNearest(Euclidean & nearest) { _nearest = &nearest; }
/**
* @param Euclidean & nearest
*/
void setNearest(Euclidean & nearest) { _nearest = &nearest; }
/**
* @return const Euclidean*
*/
Euclidean* getNearest() const { return _nearest; }
/**
* @return const Euclidean*
*/
Euclidean* getNearest() const { return _nearest; }
/**
* @param const Euclidean & euclidean
* @return const double
*/
double computeDistanceFrom(const Euclidean & euclidean) const;
/**
* @param const Euclidean & euclidean
* @return const double
*/
double computeDistanceFrom(const Euclidean & euclidean) const;
/**
* @param const std::vector<Euclidean>
* @return double
*/
static double max(const std::vector<Euclidean> vect);
/**
* @param const std::vector<Euclidean>
* @return double
*/
static double max(const std::vector<Euclidean> vect);
/**
* @param const std::vector<Euclidean>
* @return double
*/
static double min(const std::vector<Euclidean> vect);
/**
* @param const std::vector<Euclidean>
* @return double
*/
static double min(const std::vector<Euclidean> vect);
private:
private:
int _x;
int _x;
int _y;
int _y;
double _distance;
double _distance;
Euclidean *_nearest;
Euclidean *_nearest;
};
#endif

View File

@ -34,6 +34,7 @@ double sum(CImg<float> img, int startedX, int startedY, int w) {
}
}
}
return res;
}