GRASS 8 Programmer's Manual
8.6.0dev(2026)-8843f13794
Loading...
Searching...
No Matches
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
SPDX-FileCopyrightText: 2001-2009 GRASS Development Team
7
SPDX-License-Identifier: GPL-2.0-or-later
8
9
\author Original author CERL
10
*/
11
12
#include <
grass/cluster.h
>
13
14
/*!
15
\brief ?
16
17
\param C pointer to Cluster structure
18
19
\return 0
20
*/
21
int
I_cluster_merge
(
struct
Cluster
*C)
22
{
23
int
band, p;
24
int
c1
,
c2
;
25
26
c1
= C->
merge1
;
27
c2
= C->
merge2
;
28
29
for
(p = 0; p < C->
npoints
; p++)
30
if
(C->
class
[p] ==
c2
)
31
C->
class
[p] =
c1
;
32
C->
count
[
c1
] += C->
count
[
c2
];
33
C->
count
[
c2
] = 0;
34
for
(band = 0; band < C->
nbands
; band++) {
35
C->
sum
[band][
c1
] += C->
sum
[band][
c2
];
36
C->
sum
[band][
c2
] = 0;
37
}
38
39
return
0;
40
}
I_cluster_merge
int I_cluster_merge(struct Cluster *C)
?
Definition
c_merge.c:21
AMI_STREAM
Definition
ami_stream.h:153
cluster.h
Cluster
Definition
cluster.h:7
Cluster::count
int * count
Definition
cluster.h:18
Cluster::npoints
int npoints
Definition
cluster.h:9
Cluster::class
int * class
Definition
cluster.h:16
Cluster::merge2
int merge2
Definition
cluster.h:27
Cluster::merge1
int merge1
Definition
cluster.h:27
Cluster::sum
double ** sum
Definition
cluster.h:20
Cluster::nbands
int nbands
Definition
cluster.h:8
lib
cluster
c_merge.c
Generated on Tue Sep 15 2026 06:57:38 for GRASS 8 Programmer's Manual by
1.9.8