4 /* Danger Will Robinson
! */
7 %typemap
(in
) double
* {
13 croak
("Math::GSL : $input is not a reference!");
14 if
(SvTYPE
(SvRV
($input
)) != SVt_PVAV
)
15 croak
("Math::GSL : $input is not an array ref!");
17 tempav
= (AV
*)SvRV
($input
);
19 $
1 = (double
*) malloc
((len
+1)*sizeof
(double
));
20 for
(i
= 0; i
<= len
; i
++) {
21 tv
= av_fetch
(tempav
, i
, 0);
22 $
1[i
] = (double
) SvNV
(*tv
);
26 %typemap
(argout
) double
* {
30 // Need to determine length of $
1
32 //printf
("setting stuff %f\n", $
1[i
]);
33 av_push
(tempav
, newSVnv
((double
) $
1[i
]));
37 $result
= sv_2mortal
( newRV_noinc
( (SV
*) tempav
) );
38 //Perl_sv_dump
($result
);
42 %apply double
* { double
*data
};
45 #include
"/usr/local/include/gsl/gsl_nan.h"
46 #include
"/usr/local/include/gsl/gsl_sort.h"
47 #include
"/usr/local/include/gsl/gsl_sort_double.h"
48 #include
"/usr/local/include/gsl/gsl_sort_int.h"
49 #include
"/usr/local/include/gsl/gsl_sort_vector.h"
50 #include
"/usr/local/include/gsl/gsl_sort_vector_double.h"
51 #include
"/usr/local/include/gsl/gsl_sort_vector_int.h"
53 %include
"/usr/local/include/gsl/gsl_nan.h"
54 %include
"/usr/local/include/gsl/gsl_sort.h"
55 %include
"/usr/local/include/gsl/gsl_sort_double.h"
56 %include
"/usr/local/include/gsl/gsl_sort_int.h"
57 %include
"/usr/local/include/gsl/gsl_sort_vector.h"
58 %include
"/usr/local/include/gsl/gsl_sort_vector_double.h"
59 %include
"/usr/local/include/gsl/gsl_sort_vector_int.h"
64 gsl_sort gsl_sort_index
65 gsl_sort_smallest gsl_sort_smallest_index
66 gsl_sort_largest gsl_sort_largest_index
69 gsl_sort_vector gsl_sort_vector_index
70 gsl_sort_vector_smallest gsl_sort_vector_smallest_index
71 gsl_sort_vector_largest gsl_sort_vector_largest_index
73 @EXPORT_OK
= ( @EXPORT_plain
, @EXPORT_vector
);
75 all
=> [ @EXPORT_OK
],
76 plain
=> [ @EXPORT_plain
],
77 vector
=> [ @EXPORT_vector
],