ocssw
V2022
|
#include <stddef.h>
Go to the source code of this file.
Functions | |
int **** | allocate4d_int (size_t nr, size_t nz, size_t ny, size_t nx) |
void | free4d_int (int ****p) |
float **** | allocate4d_float (size_t nr, size_t nz, size_t ny, size_t nx) |
void | free4d_float (float ****p) |
double **** | allocate4d_double (size_t nr, size_t nz, size_t ny, size_t nx) |
void | free4d_double (double ****p) |
Detailed Description
Utility functions for allocating and freeing four-dimensional arrays of various types.
This file was created by allocate4d.pl and should not be edited manually.
Definition in file allocate4d.h.
Function Documentation
◆ allocate4d_double()
double**** allocate4d_double | ( | size_t | nr, |
size_t | nz, | ||
size_t | ny, | ||
size_t | nx | ||
) |
Allocate a four-dimensional array of type double of a given size.
The order of the parameters are (now) the same as when the data is being accessed. E.g., this is valid (ignoring the printf type specifier):
double ****array = allocate4d_double(1,7, 5, 1); printf("%d\n", array[0][6][4][0]);
- Parameters
-
[in] nr slowest incrimenting dimension of array in memory. [in] nz slow incrimenting dimension of array in memory. [in] ny fast dimension of array. [in] nx fastest incrimenting dimension of array.
- Returns
- A malloc'd array or NULL if any malloc fails.
Definition at line 100 of file allocate4d.c.
◆ allocate4d_float()
float**** allocate4d_float | ( | size_t | nr, |
size_t | nz, | ||
size_t | ny, | ||
size_t | nx | ||
) |
Allocate a four-dimensional array of type float of a given size.
The order of the parameters are (now) the same as when the data is being accessed. E.g., this is valid (ignoring the printf type specifier):
float ****array = allocate4d_float(1,7, 5, 1); printf("%d\n", array[0][6][4][0]);
- Parameters
-
[in] nr slowest incrimenting dimension of array in memory. [in] nz slow incrimenting dimension of array in memory. [in] ny fast dimension of array. [in] nx fastest incrimenting dimension of array.
- Returns
- A malloc'd array or NULL if any malloc fails.
Definition at line 56 of file allocate4d.c.
◆ allocate4d_int()
int**** allocate4d_int | ( | size_t | nr, |
size_t | nz, | ||
size_t | ny, | ||
size_t | nx | ||
) |
Allocate a four-dimensional array of type int of a given size.
The order of the parameters are (now) the same as when the data is being accessed. E.g., this is valid (ignoring the printf type specifier):
int ****array = allocate4d_int(1,7, 5, 1); printf("%d\n", array[0][6][4][0]);
- Parameters
-
[in] nr slowest incrimenting dimension of array in memory. [in] nz slow incrimenting dimension of array in memory. [in] ny fast dimension of array. [in] nx fastest incrimenting dimension of array.
- Returns
- A malloc'd array or NULL if any malloc fails.
Definition at line 12 of file allocate4d.c.
◆ free4d_double()
void free4d_double | ( | double **** | p | ) |
Free a four-dimensional array created by allocate4d_double.
- Parameters
-
[in] p Pointer to array created by allocate4d_double.
Definition at line 137 of file allocate4d.c.
◆ free4d_float()
void free4d_float | ( | float **** | p | ) |
Free a four-dimensional array created by allocate4d_float.
- Parameters
-
[in] p Pointer to array created by allocate4d_float.
Definition at line 93 of file allocate4d.c.
◆ free4d_int()
void free4d_int | ( | int **** | p | ) |
Free a four-dimensional array created by allocate4d_int.
- Parameters
-
[in] p Pointer to array created by allocate4d_int.
Definition at line 49 of file allocate4d.c.