2 #include <grass/cluster.h>
4 #define FAR ((double) -1.0)
17 if (C->count[class1] < 2)
19 if (C->count[class2] < 2)
21 n1 = (double)C->count[class1];
22 n2 = (
double)C->count[class2];
26 for (band = 0; band < C->nbands; band++) {
27 s1 = C->sum[band][class1];
28 s2 = C->sum[band][class2];
36 var = C->sum2[band][class1] - (s1 * m1);
41 var = C->sum2[band][class2] - (s2 * m2);
52 a1 = sqrt(6 * d / a1);
54 a2 = sqrt(6 * d / a2);
double I_cluster_separation(struct Cluster *C, int class1, int class2)