14#include <grass/cluster.h>
15#include <grass/glocale.h>
33 double convergence,
double separation,
int min_class_size,
34 int (*checkpoint)(
struct Cluster *,
int),
int *interrupted)
43 G_warning(_(
"Not enough data points (%d) in cluster"), C->npoints);
50 C->nclasses = maxclass;
52 if (min_class_size <= 0)
54 if (min_class_size < 2)
59 if (convergence <= 0.0)
84 for (C->iteration = 1;; C->iteration++) {
97 C->percent_stable = (C->npoints - changes) * 100.0;
98 C->percent_stable /= (double)C->npoints;
103 if (C->iteration >= iterations)
106 if (C->percent_stable < convergence)
int I_cluster_assign(struct Cluster *C, int *interrupted)
Assign cluster.
int I_cluster_distinct(struct Cluster *C, double separation)
Get distinct value.
int I_cluster_exec(struct Cluster *C, int maxclass, int iterations, double convergence, double separation, int min_class_size, int(*checkpoint)(struct Cluster *, int), int *interrupted)
int I_cluster_exec_allocate(struct Cluster *C)
Allocate Cluster structure.
int I_cluster_means(struct Cluster *C)
Calculate means value.
int I_cluster_merge(struct Cluster *C)
?
int I_cluster_reassign(struct Cluster *C, int *interrupted)
?
int I_cluster_reclass(struct Cluster *C, int minsize)
Reclass data.
int I_cluster_signatures(struct Cluster *C)
Create signatures.
int I_cluster_sum2(struct Cluster *C)
Compute sum of squares for each class.
void G_warning(const char *msg,...)
Print a warning message to stderr.