Fiddle with Typemaps. Poly is happy, Sort is not.
[Math-GSL.git] / Poly.i
blob896820f127489f4013c3534a3fe8fa66d6704835
1 %module Poly
2 %include "GSL.i"
3 %typemap(in) double * (double dvalue) {
4 SV* tempsv;
5 printf("FOO\n");
6 if (!SvROK($input)) {
7 croak("Math::GSL::Sort : $input is not a reference!\n");
9 tempsv = SvRV($input);
10 if ((!SvNOK(tempsv)) && (!SvIOK(tempsv))) {
11 croak("Math::GSL::Sort : $input is not a reference to number!\n");
13 dvalue = SvNV(tempsv);
14 $1 = &dvalue;
16 %typemap(argout) double * {
17 SV *tempsv;
18 tempsv = SvRV($input);
19 sv_setnv(tempsv, *$1);
21 %include "typemaps.i"
23 #include "/usr/local/include/gsl/gsl_nan.h"
24 #include "/usr/local/include/gsl/gsl_poly.h"
25 #include "/usr/local/include/gsl/gsl_complex.h"
28 %include "/usr/local/include/gsl/gsl_nan.h"
29 %include "/usr/local/include/gsl/gsl_poly.h"
30 %include "/usr/local/include/gsl/gsl_complex.h"
33 %perlcode %{
35 @EXPORT_OK = qw(gsl_poly_eval gsl_poly_solve_quadratic);
36 %EXPORT_TAGS = ( all => [ @EXPORT_OK ] );