21 #include <grass/cluster.h>
25 double separation,
int min_class_size,
26 int (*checkpoint) (),
int *interrupted)
35 fprintf(stderr,
"cluster: not enough data points (%d)\n", C->npoints);
42 C->nclasses = maxclass;
44 if (min_class_size <= 0)
46 if (min_class_size < 2)
51 if (convergence <= 0.0)
78 for (C->iteration = 1;; C->iteration++) {
91 C->percent_stable = (C->npoints - changes) * 100.0;
92 C->percent_stable /= (double)C->npoints;
97 if (C->iteration >= iterations)
100 if (C->percent_stable < convergence)
109 (*checkpoint) (
C, 4);
int I_cluster_merge(struct Cluster *C)
int I_cluster_exec_allocate(struct Cluster *C)
int I_cluster_exec(struct Cluster *C, int maxclass, int iterations, double convergence, double separation, int min_class_size, int(*checkpoint)(), int *interrupted)
int I_cluster_means(struct Cluster *C)
int I_cluster_assign(struct Cluster *C, int *interrupted)
int I_cluster_sum2(struct Cluster *C)
int I_cluster_reclass(struct Cluster *C, int minsize)
int I_cluster_distinct(struct Cluster *C, double separation)
int I_cluster_reassign(struct Cluster *C, int *interrupted)
int I_cluster_signatures(struct Cluster *C)