Skip to content

About

A simply 2D and 3D dynamic array allocator in C, where elements are contiguous in memory.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

--- Contiguous:
--- A 2D & 3D dynamic contiguous array allocator in C.

-------------------------------------------------------------------------
Introduction:
The current program is a 2D & 3D dynamic array allocator that allocates 
contiguous arrays in memory. Contiguous arrays are useful, not only 
for better cache memory access, but also for MPI applications that 
need contiguous memory for sending and receiving data between processes.

Arrays are created so that elements can be accessed using indices according 
to the dimensions. For example, a[i][j] for 2D and a[i][j][k] for 3D.

The current program allocates a 2D / 3D array of doubles; changing this to 
whatever type the user may need is trivial.

The functions have been checked with Valgrind for memory leaks and were
found to be free of leaks.

-------------------------------------------------------------------------
Functions:

  2D
  - array2D_contiguous_double: allocates 2D of given dimensions and initializes 
    to zero.

  - free_array2D_contiguous_double: frees memory allocated by 
    array2D_contiguous_double.

  3D
  - array3D_contiguous_double: allocates 3D of given dimensions and initializes 
    to zero.

  - free_array3D_contiguous_double: frees memory allocated by 
    array3D_contiguous_double.

-------------------------------------------------------------------------

About

A simply 2D and 3D dynamic array allocator in C, where elements are contiguous in memory.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages