4 /* Danger Will Robinson
! */
7 %typemap
(in
) double
* {
12 printf
("typemap(in)\n");
14 croak
("Math::GSL : $input is not a reference!");
15 if
(SvTYPE
(SvRV
($input
)) != SVt_PVAV
)
16 croak
("Math::GSL : $input is not an array ref!");
18 tempav
= (AV
*)SvRV
($input
);
20 $
1 = (double
*) malloc
((len
+1)*sizeof
(double
));
21 for
(i
= 0; i
<= len
; i
++) {
22 tv
= av_fetch
(tempav
, i
, 0);
23 $
1[i
] = (double
) SvNV
(*tv
);
28 %typemap
(argout
) double
* {
32 printf
("woohoo $result \n");
35 printf
("setting stuff %f\n", $
1[i
]);
36 av_push
(tempav
, newSVnv
((double
) $
1[i
]));
40 $result
= sv_2mortal
( newRV_noinc
( (SV
*) tempav
) );
41 //Perl_sv_dump
($result
);
45 %apply double
* { double
*data
};
47 void gsl_sort
(double
* data
, const size_t stride
, const size_t n
);
51 #include
"/usr/local/include/gsl/gsl_nan.h"
52 #include
"/usr/local/include/gsl/gsl_sort.h"
53 #include
"/usr/local/include/gsl/gsl_sort_double.h"
54 #include
"/usr/local/include/gsl/gsl_sort_int.h"
55 #include
"/usr/local/include/gsl/gsl_sort_vector.h"
56 #include
"/usr/local/include/gsl/gsl_sort_vector_double.h"
57 #include
"/usr/local/include/gsl/gsl_sort_vector_int.h"
59 %include
"/usr/local/include/gsl/gsl_nan.h"
60 %include
"/usr/local/include/gsl/gsl_sort.h"
61 %include
"/usr/local/include/gsl/gsl_sort_double.h"
62 %include
"/usr/local/include/gsl/gsl_sort_int.h"
63 %include
"/usr/local/include/gsl/gsl_sort_vector.h"
64 %include
"/usr/local/include/gsl/gsl_sort_vector_double.h"
65 %include
"/usr/local/include/gsl/gsl_sort_vector_int.h"
70 gsl_sort gsl_sort_index
71 gsl_sort_smallest gsl_sort_smallest_index
72 gsl_sort_largest gsl_sort_largest_index
75 gsl_sort_vector gsl_sort_vector_index
76 gsl_sort_vector_smallest gsl_sort_vector_smallest_index
77 gsl_sort_vector_largest gsl_sort_vector_largest_index
79 @EXPORT_OK
= ( @EXPORT_plain
, @EXPORT_vector
);
81 all
=> [ @EXPORT_OK
],
82 plain
=> [ @EXPORT_plain
],
83 vector
=> [ @EXPORT_vector
],