Arrays for arbitrary dimensions. Done by constructing 1D arrays. Handles memory alignment also. More...
Functions | |
NTTW_DLL_SYM void | array (void **pointer, const size_t nbytes) |
Forms an array of size. | |
NTTW_DLL_SYM nttw_integer * | array_1D (const size_t size) |
Forms an 1D array of size. | |
NTTW_DLL_SYM long * | arraySigned_1D (const size_t size) |
Forms an 1D signed array of size. | |
NTTW_DLL_SYM unsigned char * | arrayUChar_1D (const size_t size) |
Forms an 1D unsigned character array of size. | |
NTTW_DLL_SYM nttw_big_integer * | array_1D_big (const size_t size) |
Forms an 1D array of size. | |
NTTW_DLL_SYM void | init_1D (nttw_integer *data, const size_t size, const nttw_integer value) |
NTTW_DLL_SYM void | initSigned_1D (long *data, const size_t size, const long value) |
NTTW_DLL_SYM void | initUChar_1D (unsigned char *data, const size_t size, const unsigned char value) |
NTTW_DLL_SYM void | init_1D_big (nttw_big_integer *data, const size_t size, const nttw_big_integer value) |
NTTW_DLL_SYM void | free_array (void *pointer) |
Arrays for arbitrary dimensions. Done by constructing 1D arrays. Handles memory alignment also.
The main function is array_1D() and free array by using free_array(). These functions handle memory alignment independently of platform.
array | ( | void ** | pointer, | |
const size_t | nbytes | |||
) |
Forms an array of size.
pointer | Pointer to the array to be allocated. It's a Double pointer because it is passed by reference. | |
nbytes | The bytes to be allocated. Use the sizeof() function here. |
Constructs a array for 1D reference. Reference into array as j*columns+k, where j is the current row and k the current column. The malloc function is used to allocate the memory and garbage collection is NOT automated, please use free_array() to deallocate the memory.
array_1D | ( | const size_t | size | ) |
Forms an 1D array of size.
Constructs a 1-dimensional array of type nttw_integer (defined in global.h). Allocates 16-bit integers in 32-bit mode or 32-bit integers in 64-bit mode. The malloc function is used to allocate the memory and garbage collection is NOT automated, please use free_array() to deallocate the memory.
array_1D_big | ( | const size_t | size | ) |
Forms an 1D array of size.
Constructs a 1-dimensional array of type nttw_integer (defined in global.h). Allocats 32-bit integers in 32-bit mode or 64-bit integers in 64-bit mode. The malloc function is used to allocate the memory and garbage collection is NOT automated, please use free_array() to deallocate the memory.
arraySigned_1D | ( | const size_t | size | ) |
Forms an 1D signed array of size.
Constructs a 1-dimensional array of type long. Allocates signed integers of maximum machine word size. The malloc function is used to allocate the memory and garbage collection is NOT automated, please use free_array() to deallocate the memory.
arrayUChar_1D | ( | const size_t | size | ) |
Forms an 1D unsigned character array of size.
Constructs a 1-dimensional array of type unsigned char. The malloc function is used to allocate the memory and garbage collection is NOT automated, please use free_array() to deallocate the memory.
free_array | ( | void * | pointer | ) |
Frees the Byte Aligned array allocated by array() or array_1D() correctly.
init_1D | ( | nttw_integer * | data, | |
const size_t | size, | |||
const nttw_integer | value | |||
) |
init_1D_big | ( | nttw_big_integer * | data, | |
const size_t | size, | |||
const nttw_big_integer | value | |||
) |
initSigned_1D | ( | long * | data, | |
const size_t | size, | |||
const long | value | |||
) |