GRASS GIS 7 Programmer's Manual
7.9.dev(2021)-e5379bbd7
Main Page
Related Pages
+
Data Structures
Data Structures
Class Hierarchy
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
+
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
~
+
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Related Functions
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
w
x
y
+
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
o
p
r
s
t
u
v
w
y
z
+
Enumerations
a
c
d
e
h
l
m
n
o
p
r
s
t
v
y
+
Enumerator
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
+
Macros
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
▼
GRASS GIS 7 Programmer's Manual
Libraries
Core libraries
►
Further libraries
File structure of GRASS Location
►
Compiling and Installing GRASS Modules
Multiple-Architecture Conventions
►
Vector modules and their parameters/flags
►
GRASS Array Statistics Library
btree2 library
►
GRASS Cairo Display Driver
►
GRASS testing normality & exponentiality Library
►
GRASS Cluster analysis statistics Library
►
GRASS DataBase Management Interface
►
GRASS Display Library
►
CCMATH mathematics library source code
►
GRASS GIS General Library (aka GIS Library)
►
GRASS Numerical math interface
►
GRASS Partial differential equations Library (GPDE)
►
GRASS Imagery Library
►
GRASS Data Elements Manage Library
►
GRASS Nviz Library
►
GRASS GIS OGSF Library
GRASS GIS PNG Display Driver Library
►
GRASS and the PROJ projection library
GRASS Postscript Display Driver Library
►
GRASS Raster Library
►
GRASS 3D Raster Volume Library
GRASS Row Input/Output Library
GRASS Library for interpolation with regularized splines with tension
►
GRASS Segment Library
►
GRASS Directed Graph Library
►
GRASS Vector Library
Todo List
Deprecated List
Bug List
►
Data Structures
▼
Files
►
File List
►
Globals
•
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
xand2.c
Go to the documentation of this file.
1
2
#include <
grass/gis.h
>
3
#include <
grass/raster.h
>
4
#include <
grass/calc.h
>
5
6
/****************************************************************
7
and2(a,b,c,...) = a && b && c && ...
8
9
Differs from and() in that the boolean axioms:
10
11
false && x == false
12
x && false == false
13
14
hold even when x is null.
15
****************************************************************/
16
17
int
f_and2
(
int
argc,
const
int
*argt,
void
**args)
18
{
19
CELL
*res = args[0];
20
CELL
**argz = (
CELL
**) args;
21
int
i, j;
22
23
if
(argc < 1)
24
return
E_ARG_LO
;
25
26
if
(argt[0] !=
CELL_TYPE
)
27
return
E_RES_TYPE
;
28
29
for
(i = 1; i <= argc; i++)
30
if
(argt[i] !=
CELL_TYPE
)
31
return
E_ARG_TYPE
;
32
33
for
(i = 0; i <
columns
; i++) {
34
res[i] = 1;
35
for
(j = 1; j <= argc; j++) {
36
if
(!
IS_NULL_C
(&argz[j][i]) && !argz[j][i]) {
37
res[i] = 0;
38
break
;
39
}
40
if
(
IS_NULL_C
(&argz[j][i]))
41
SET_NULL_C
(&res[i]);
42
}
43
}
44
45
return
0;
46
}
CELL_TYPE
#define CELL_TYPE
Definition:
raster.h:11
SET_NULL_C
#define SET_NULL_C(x)
Definition:
calc.h:32
E_ARG_TYPE
Definition:
calc.h:14
IS_NULL_C
#define IS_NULL_C(x)
Definition:
calc.h:28
columns
int columns
Definition:
calc.c:12
raster.h
gis.h
f_and2
int f_and2(int argc, const int *argt, void **args)
Definition:
xand2.c:17
E_ARG_LO
Definition:
calc.h:12
CELL
int CELL
Definition:
gis.h:602
E_RES_TYPE
Definition:
calc.h:15
calc.h
lib
calc
xand2.c
Generated on Mon May 31 2021 05:21:32 for GRASS GIS 7 Programmer's Manual by
1.8.13