Adding raw, get and as_list wrapper for Permutation and modifying the new wrapper.
[Math-GSL.git] / gsl_typemaps.i
blob307cd3662c2f70ee8f37d62fbd6a7a022f67b7e9
2 %typemap(in) double const [] {
3 AV *tempav;
4 I32 len;
5 int i;
6 SV **tv;
7 if (!SvROK($input))
8 croak("Math::GSL : $input is not a reference!");
9 if (SvTYPE(SvRV($input)) != SVt_PVAV)
10 croak("Math::GSL : $input is not an array ref!");
12 tempav = (AV*)SvRV($input);
13 len = av_len(tempav);
14 $1 = (double *) malloc((len+1)*sizeof(double));
15 for (i = 0; i <= len; i++) {
16 tv = av_fetch(tempav, i, 0);
17 $1[i] = (double) SvNV(*tv);
20 %apply double const [] { double *data };
21 %apply double const [] { double x[] };
23 %typemap(argout) double const [] {
24 printf("argout double const\n");