Adding a test with a new typemap to BLAS and the .t file for testing correctly
[Math-GSL.git] / gsl_typemaps.i
blob45470ac22d852a58fc057771e546ea86d3e7da0c
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[] };
22 %apply double const [] { double a[], double b[], double c[], double s[]};