GRASS GIS 7 Programmer's Manual  7.7.svn(2018)-r73666
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GRASS Cluster analysis statistics Library

by GRASS Development Team (


This library does a k-means style of cluster analysis. It is currently only used by i.cluster.

The library functions are defined in cluster.h.

#include <grass/cluster.h>

Cluster structure

struct Cluster
int nbands; /* number of bands */
int npoints; /* number of points */
DCELL **points; /* array of points */
int np;
double *band_sum; /* sum over each band */
double *band_sum2; /* sum of squares over each band */
int *class; /* class of each point */
int *reclass; /* for removing empty classes */
int *count; /* number of points in each class */
int *countdiff; /* change in count */
double **sum; /* sum over band per class */
double **sumdiff; /* change in sum */
double **sum2; /* sum of squares per band per class */
double **mean; /* initial class means */
struct Signature S; /* final signature(s) */
int nclasses; /* number of classes */
int merge1, merge2;
int iteration; /* number of iterations */
double percent_stable; /* percentage stable */

List of functions