1 %module
"Math::GSL::Deriv"
2 // Danger Will Robinson
, for realz
!
5 %include
"gsl_typemaps.i"
6 %typemap
(argout
) (const gsl_function
*f
,
8 double
*result
, double
*abserr
) {
11 sv
= hv_fetch
(Callbacks
, (char
*)&$input, sizeof($input), FALSE );
13 croak
("Math::GSL(argout) : Missing callback!\n");
17 // these are the arguments passed to the callback
18 XPUSHs
(sv_2mortal
(newSViv
((int
)$
2)));
19 // shouldnt we be doing something with $
3 ?
22 /* This actually calls the perl subroutine
, in scalar context
*/
23 call_sv
(*sv
, G_SCALAR
);
25 $result
= sv_newmortal
();
26 sv_setnv
($result
, (double
) *$
4);
28 sv_setnv
($result
, (double
) *$
5);
36 // this is rarely prudent but seems to work
38 $
1 = (double
*) $input
;
41 #include
"gsl/gsl_math.h"
42 #include
"gsl/gsl_deriv.h"
45 %include
"gsl/gsl_math.h"
46 %include
"gsl/gsl_deriv.h"
47 %include
"../pod/Deriv.pod"