GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
c_merge.c
Go to the documentation of this file.
1
/*!
2
\file cluster/c_merge.c
3
4
\brief Cluster library - Merge
5
6
(C) 2001-2009 by the GRASS Development Team
7
8
This program is free software under the GNU General Public License
9
(>=v2). Read the file COPYING that comes with GRASS for details.
10
11
\author Original author CERL
12
*/
13
14
#include <
grass/cluster.h
>
15
16
/*!
17
\brief ?
18
19
\param C pointer to Cluster structure
20
21
\return 0
22
*/
23
int
I_cluster_merge
(
struct
Cluster
*C)
24
{
25
int
band, p;
26
int
c1, c2;
27
28
c1 = C->
merge1
;
29
c2 = C->
merge2
;
30
31
for
(p = 0; p < C->
npoints
; p++)
32
if
(C->
class
[p] == c2)
33
C->
class
[p] = c1;
34
C->
count
[c1] += C->
count
[c2];
35
C->
count
[c2] = 0;
36
for
(band = 0; band < C->
nbands
; band++) {
37
C->
sum
[band][c1] += C->
sum
[band][c2];
38
C->
sum
[band][c2] = 0;
39
}
40
41
return
0;
42
}
Cluster::nbands
int nbands
Definition:
cluster.h:9
Cluster::sum
double ** sum
Definition:
cluster.h:21
Cluster::merge1
int merge1
Definition:
cluster.h:28
I_cluster_merge
int I_cluster_merge(struct Cluster *C)
?
Definition:
c_merge.c:23
Cluster
Definition:
cluster.h:7
Cluster::npoints
int npoints
Definition:
cluster.h:10
Cluster::count
int * count
Definition:
cluster.h:19
Cluster::class
int * class
Definition:
cluster.h:17
Cluster::merge2
int merge2
Definition:
cluster.h:28
cluster.h
lib
cluster
c_merge.c
Generated on Tue Feb 14 2023 05:55:58 for GRASS GIS 8 Programmer's Manual by
1.8.13