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