|
|
@ -24,17 +24,19 @@ void meanshift(double **x, int h, struct parameters *opt){ |
|
|
|
// initialize iteration counter
|
|
|
|
int iter = 0; |
|
|
|
|
|
|
|
// printf("%f \n", opt->epsilom);
|
|
|
|
// printf("%f \n", opt->epsilon);
|
|
|
|
|
|
|
|
double ** W = alloc_2d_double(ROWS, ROWS); |
|
|
|
double * l = malloc(ROWS * sizeof(double)); |
|
|
|
|
|
|
|
/** iterate until convergence **/ |
|
|
|
// printf("norm : %f \n", norm(m, ROWS, COLUMNS));
|
|
|
|
|
|
|
|
while (norm(m, ROWS, COLUMNS) > opt->epsilom) { |
|
|
|
while (norm(m, ROWS, COLUMNS) > opt->epsilon) { |
|
|
|
iter = iter +1; |
|
|
|
// find pairwise distance matrix (inside radius)
|
|
|
|
/** allocate memory for inside iteration arrays **/ |
|
|
|
double ** W = alloc_2d_double(ROWS, ROWS); |
|
|
|
double * l = malloc(ROWS * sizeof(double)); |
|
|
|
|
|
|
|
// [I, D] = rangesearch(x,y,h);
|
|
|
|
for (int i=0; i<ROWS; i++){ |
|
|
|
for (int j=0; j<ROWS; j++){ |
|
|
|