GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
ialloc.c
Go to the documentation of this file.
1
27
#include <stdlib.h>
28
#include <grass/gis.h>
29
30
41
int
*
G_alloc_ivector
(
size_t
n)
42
{
43
return
(
int
*)G_calloc(n,
sizeof
(
int
));
44
}
45
58
int
**
G_alloc_imatrix
(
int
rows,
int
cols
)
59
{
60
int
**m;
61
int
i;
62
63
m = (
int
**)G_calloc(rows,
sizeof
(
int
*));
64
m[0] = (
int
*)G_calloc(rows * cols,
sizeof
(
int
));
65
for
(i = 1; i < rows; i++)
66
m[i] = m[i - 1] + cols;
67
68
return
m;
69
}
70
81
void
G_free_ivector
(
int
*v)
82
{
83
G_free
(v);
84
v =
NULL
;
85
86
return
;
87
}
88
99
void
G_free_imatrix
(
int
**m)
100
{
101
G_free
(m[0]);
102
G_free
(m);
103
m =
NULL
;
104
105
return
;
106
}
lib
gmath
ialloc.c
Generated on Thu Sep 26 2013 09:48:03 for GRASS Programmer's Manual by
1.8.4