13.07.2014 Views

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

Madagascar Programming Reference Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

4.1. CONVENIENCE ALLOCATION PROGRAMS (ALLOC.C) 45<br />

n4<br />

number of elements in the slower dimension (size t).<br />

Output<br />

ptr<br />

a void pointer pointing to the allocated block of memory.<br />

4.1.19 sf floatalloc5<br />

Allocates a 5D array in the memory for the float type. It works just like sf floatalloc2<br />

but does it for four dimensions. This is done by extending the same argument as for<br />

sf floatalloc2 but this time making a pointer such that Pointer4 -> Pointer3 -><br />

Pointer2 -> Pointer1 -> Pointer. n1 is the fastest dimension.<br />

Call<br />

ptr = sf_floatalloc5 (n1, n2, n3, n4, n5);<br />

Definition<br />

float *****sf_floatalloc5 (size_t n1 /* fast dimension */,<br />

size_t n2 /* slower dimension */,<br />

size_t n3 /* slower dimension */,<br />

size_t n4 /* slower dimension */,<br />

size_t n5 /* slowest dimension */)<br />

/*< float 5-D allocation, out[0][0][0][0] points to a contiguous array >*/<br />

{<br />

...<br />

}<br />

Input parameters<br />

n1<br />

n2<br />

n3<br />

n4<br />

n5<br />

number of elements in the fastest dimension (size t).<br />

number of elements in the slower dimension (size t).<br />

number of elements in the slower dimension (size t).<br />

number of elements in the slower dimension (size t).<br />

number of elements in the slower dimension (size t).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!