15 double ***amat = NULL;
17 amat = (
double ***)calloc((
size_t)
nx,
sizeof(
double **));
21 *amat = (
double **)calloc((
size_t)(nx*
ny),
sizeof(
double *));
24 for (i = 1; i <
nx; i++)
25 amat[i] = &amat[0][i*ny];
27 **amat = (
double *)calloc((
size_t)(nx*ny*nz),
sizeof(
double));
30 for (i = 0; i <
nx; i++)
31 for (j = 0; j <
ny; j++)
32 amat[i][j] = &amat[0][0][i*ny*nz+j*nz];
39 free ((
void *)**amat);
40 free ((
void *) *amat);
54 amat = (
float ***)calloc((
size_t)
nx,
sizeof(
float **));
58 *amat = (
float **)calloc((
size_t)(nx*
ny),
sizeof(
float *));
61 for (i = 1; i <
nx; i++)
62 amat[i] = &amat[0][i*ny];
64 **amat = (
float *)calloc((
size_t)(nx*ny*nz),
sizeof(
float));
67 for (i = 0; i <
nx; i++)
68 for (j = 0; j <
ny; j++)
69 amat[i][j] = &amat[0][0][i*ny*nz+j*nz];
76 free ((
void *)**amat);
77 free ((
void *) *amat);
91 amat = (
int ***)calloc((
size_t)
nx,
sizeof(
int **));
95 *amat = (
int **)calloc((
size_t)(nx*
ny),
sizeof(
int *));
98 for (i = 1; i <
nx; i++)
99 amat[i] = &amat[0][i*ny];
101 **amat = (
int *)calloc((
size_t)(nx*ny*nz),
sizeof(
int));
104 for (i = 0; i <
nx; i++)
105 for (j = 0; j <
ny; j++)
106 amat[i][j] = &amat[0][0][i*ny*nz+j*nz];
113 free ((
void *)**amat);
114 free ((
void *) *amat);
115 free ((
void *) amat);
125 double **amat = NULL;
130 amat = (
double **)calloc((
size_t)
nx,
sizeof(
double *));
134 *amat = (
double *)calloc((
size_t)(nx*
ny),
sizeof(
double));
138 for (i = 1; i <
nx; i++)
139 amat[i] = &amat[0][i*ny];
146 free ((
void *)*amat);
147 free ((
void *) amat);
162 amat = (
float **)calloc((
size_t)
nx,
sizeof(
float *));
166 *amat = (
float *)calloc((
size_t)(nx*
ny),
sizeof(
float));
170 for (i = 1; i <
nx; i++)
171 amat[i] = &amat[0][i*ny];
178 free ((
void *)*amat);
179 free ((
void *) amat);
194 amat = (
int **)calloc((
size_t)
nx,
sizeof(
int *));
198 *amat = (
int *)calloc((
size_t)(nx*
ny),
sizeof(
int));
202 for (i = 1; i <
nx; i++)
203 amat[i] = &amat[0][i*ny];
210 free ((
void *)*amat);
211 free ((
void *) amat);
float ** free_fmatrix(float **amat)
free 2D float matrix
double *** alloc_3Ddmatrix(int nx, int ny, int nz)
allocate 3D double matrix
float *** free_3Dfmatrix(float ***amat)
free 3D float matrix
float ** alloc_fmatrix(int nx, int ny)
allocate 2D float matrix
int *** free_3Dmatrix(int ***amat)
free 3D integer matrix
double ** alloc_dmatrix(int nx, int ny)
allocate 2D double matrix
int ** alloc_matrix(int nx, int ny)
allocate 2D integer matrix
float *** alloc_3Dfmatrix(int nx, int ny, int nz)
allocate 3D float matrix
int ** free_matrix(int **amat)
free 2D integer matrix
double *** free_3Ddmatrix(double ***amat)
free 3D double matrix
double ** free_dmatrix(double **amat)
free 2D double matrix
int *** alloc_3Dmatrix(int nx, int ny, int nz)
allocate 3D integer matrix