GRASS Programmer's Manual  6.4.2(2012)
c_merge.c
Go to the documentation of this file.
00001 #include <grass/cluster.h>
00002 
00003 int I_cluster_merge(struct Cluster *C)
00004 {
00005     int band, p;
00006     int c1, c2;
00007 
00008     c1 = C->merge1;
00009     c2 = C->merge2;
00010 
00011     for (p = 0; p < C->npoints; p++)
00012         if (C->class[p] == c2)
00013             C->class[p] = c1;
00014     C->count[c1] += C->count[c2];
00015     C->count[c2] = 0;
00016     for (band = 0; band < C->nbands; band++) {
00017         C->sum[band][c1] += C->sum[band][c2];
00018         C->sum[band][c2] = 0;
00019     }
00020 
00021     return 0;
00022 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines