1 #include <grass/cluster.h>
5 int band, c, hole, move, p;
7 for (c = 0; c < C->nclasses; c++)
11 for (hole = 0; hole < C->nclasses; hole++)
12 if (C->count[hole] < minsize)
16 if (hole >= C->nclasses)
19 for (move = hole; move < C->nclasses; move++)
20 if (C->count[move] >= minsize) {
21 C->reclass[move] = hole;
22 C->count[hole] = C->count[move];
23 for (band = 0; band < C->nbands; band++)
24 C->sum[band][hole] = C->sum[band][move];
28 C->reclass[move] = -1;
30 for (p = 0; p < C->npoints; p++)
31 C->class[p] = C->reclass[C->class[p]];
int I_cluster_reclass(struct Cluster *C, int minsize)