Hi,
I am having trouble figuring out how to use Inline to interface with
a library that handles arrays. To be specific, consider
void trig(int n, double * angles, double ** cosines, double ** sines)
{
int i;
*sines = (double *) malloc(n*sizeof(double));
*cosines = (double *) malloc(n*sizeof(double));
for (i=0; i<n; i++) {
(*cosines)[i] = cos(angles[i]);
(*sines)[i] = sin(angles[i]);
}
}
What sort of Inline wrapper should be used to allow
($cosine, $sine) = trig_wrap(n, \@angles);
where $cosine and $sine are references to perl arrays?
Thanks,
Scott