1 %module
"Math::GSL::Deriv"
3 struct gsl_function_struct
5 double
(* function
) (double x
, void
* params
);
9 typedef struct gsl_function_struct gsl_function
;
10 #define GSL_FN_EVAL
(F
,x
) (*((F
)->function
))(x
,(F
)->params
)
14 %typemap
(in
) gsl_function
* {
18 F.function
= &xsquared;
20 if
( !SvROK
($input
) ) {
21 croak
("Math::GSL : not a reference value!");
23 //Perl_sv_dump
( $input
);
26 //count
= call_sv
((SV
*) $input
, G_ARRAY
);
31 typedef struct callback_t
35 double xsquared
(double x
,void
*params
){
41 $
1 = (double
*) $input
;
43 %typemap
(in
) double
(*)(double
,void
*) {
44 fprintf
(stderr
,"input * %d \n", (int
) $input
);
45 //Perl_sv_dump
( $input
);
48 %apply double
* OUTPUT { double
*abserr
, double
*result
};
51 #include
"gsl/gsl_math.h"
52 #include
"gsl/gsl_deriv.h"
55 %include
"gsl/gsl_math.h"
56 %include
"gsl/gsl_deriv.h"
64 %EXPORT_TAGS
= ( all
=> [ @EXPORT_OK
] );