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 */
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}
int I_cluster_merge(struct Cluster *C)
?
Definition c_merge.c:21
int * count
Definition cluster.h:18
int npoints
Definition cluster.h:9
int * class
Definition cluster.h:16
int merge2
Definition cluster.h:27
int merge1
Definition cluster.h:27
double ** sum
Definition cluster.h:20
int nbands
Definition cluster.h:8