2 #include <grass/cluster.h>
14 for (band = 0; band < C->nbands; band++) {
15 s = C->band_sum[band];
17 v = C->band_sum2[band] - s * m;
18 v = sqrt(v / (C->npoints - 1));
19 for (
class = 0;
class < C->nclasses;
class++)
20 C->mean[band][
class] = m;
22 for (
class = 0;
class < C->nclasses;
class++)
23 C->mean[band][
class] +=
24 ((2.0 *
class) / (C->nclasses - 1) - 1.0) * v;
int I_cluster_means(struct Cluster *C)