#include #include #include "MeanShift.h" using namespace std; vector > load_points(const char *filename) { vector > points; FILE *fp = fopen(filename, "r"); char line[50]; while (fgets(line, sizeof(line), fp) != NULL) { double x, y; char *x_str = line; char *y_str = line; while (*y_str != '\0') { if (*y_str == ',') { *y_str++ = 0; x = atof(x_str); y = atof(y_str); vector point; point.push_back(x); point.push_back(y); points.push_back(point); break; } ++y_str; } } fclose(fp); return points; } void print_points(vector > points){ for(int i=0; i > points = load_points("test.csv"); vector > shifted_points = msp->cluster(points, kernel_bandwidth); FILE *fp = fopen("result.csv", "w"); if(!fp){ perror("Couldn't write result.csv"); exit(0); } for(int i=0; i