GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
c_merge.c
Go to the documentation of this file.
1 #include <grass/cluster.h>
2 
3 int I_cluster_merge(struct Cluster *C)
4 {
5  int band, p;
6  int c1, c2;
7 
8  c1 = C->merge1;
9  c2 = C->merge2;
10 
11  for (p = 0; p < C->npoints; p++)
12  if (C->class[p] == c2)
13  C->class[p] = c1;
14  C->count[c1] += C->count[c2];
15  C->count[c2] = 0;
16  for (band = 0; band < C->nbands; band++) {
17  C->sum[band][c1] += C->sum[band][c2];
18  C->sum[band][c2] = 0;
19  }
20 
21  return 0;
22 }
int I_cluster_merge(struct Cluster *C)
Definition: c_merge.c:3
#define C
Definition: intr_char.c:17