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
"gsl/gsl_nan.h"
46 #include
"gsl/gsl_sort.h"
47 #include
"gsl/gsl_sort_double.h"
48 #include
"gsl/gsl_sort_int.h"
49 #include
"gsl/gsl_sort_vector.h"
50 #include
"gsl/gsl_sort_vector_double.h"
51 #include
"gsl/gsl_sort_vector_int.h"
53 %include
"gsl/gsl_nan.h"
54 %include
"gsl/gsl_sort.h"
55 %include
"gsl/gsl_sort_double.h"
56 %include
"gsl/gsl_sort_int.h"
57 %include
"gsl/gsl_sort_vector.h"
58 %include
"gsl/gsl_sort_vector_double.h"
59 %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
],
83 Math
::GSL
::Sort
- Functions for sorting data
87 use Math
::GSL
::Sort qw
/:all
/;
91 Here is a list of all the functions included in this module
:
95 =item gsl_sort_vector
($v
) - This function sorts the elements of the vector v into ascending numerical order.
97 =item gsl_sort_vector_index
99 =item gsl_sort_vector_smallest
101 =item gsl_sort_vector_smallest_index
103 =item gsl_sort_vector_largest
105 =item gsl_sort_vector_largest_index
111 =item gsl_sort_smallest
113 =item gsl_sort_smallest_index
115 =item gsl_sort_largest
117 =item gsl_sort_largest_index
121 You have to add the functions you want to use inside the qw
/put_funtion_here
/.
122 You can also write use Math
::GSL
::Sort qw
/:all
/ to use all avaible functions of the module.
123 Other tags are also avaible
, here is a complete list of all tags for this module
:
135 For more informations on the functions
, we refer you to the GSL offcial documentation
: http
://www.gnu.org
/software
/gsl
/manual
/html_node
/
136 Tip
: search on google
: site
:http
://www.gnu.org
/software
/gsl
/manual
/html_node
/ name_of_the_function_you_want
142 Jonathan Leto
<jonathan@leto.net
> and Thierry Moisan
<thierry.moisan@gmail.com
>
144 =head1 COPYRIGHT
AND LICENSE
146 Copyright
(C
) 2008 Jonathan Leto and Thierry Moisan
148 This program is free software
; you can redistribute it and
/or modify it
149 under the same terms as Perl itself.