2 #include <grass/cluster.h>
20 if (C->points !=
NULL) {
21 for (band = 0; band < C->nbands; band++)
22 if (C->points[band] !=
NULL)
23 free(C->points[band]);
26 if (C->band_sum !=
NULL)
28 if (C->band_sum2 !=
NULL)
45 sprintf(C->S.title,
"produced by i.cluster");
48 C->points = (DCELL **)
malloc(C->nbands *
sizeof(DCELL *));
49 if (C->points ==
NULL)
51 for (band = 0; band < C->nbands; band++)
52 C->points[band] =
NULL;
55 for (band = 0; band < C->nbands; band++) {
56 C->points[band] = (DCELL *)
malloc(C->np *
sizeof(DCELL));
57 if (C->points[band] ==
NULL)
65 C->band_sum = (
double *)
malloc(C->nbands *
sizeof(
double));
66 if (C->band_sum ==
NULL)
68 C->band_sum2 = (
double *)
malloc(C->nbands *
sizeof(
double));
69 if (C->band_sum2 ==
NULL)
71 for (band = 0; band < C->nbands; band++) {
72 C->band_sum[band] = 0;
73 C->band_sum2[band] = 0;
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
int I_init_signatures(struct Signature *S, int nbands)
int I_free_signatures(struct Signature *S)
int I_cluster_begin(struct Cluster *C, int nbands)