fix warnings

This commit is contained in:
Sébastien Loriot 2013-12-17 09:23:00 +01:00
parent 98f0bc2d86
commit 3a0853a27b
2 changed files with 4 additions and 3 deletions

View File

@ -148,8 +148,9 @@ class K_means_point
public:
double data; /**< Location of the point */
std::size_t center_id; /**< Closest center to the point */
K_means_point(double data, std::size_t center_id = -1) : data(data),
center_id(center_id) {
K_means_point(double data,
std::size_t center_id = (std::numeric_limits<std::size_t>::max)())
: data(data), center_id(center_id) {
}
operator double() const {

View File

@ -20,7 +20,7 @@ int main(void)
// unique point generate
std::vector<double> points;
for(std::size_t i = 0; i < center_size; ++i) {
points.push_back(i);
points.push_back(static_cast<double>(i));
}
// test kmeans, expected result: each point has its own cluster