1 %module
"Math::GSL::Sort"
2 /* Danger Will Robinson
! */
5 %include
"gsl_typemaps.i"
7 %typemap
(argout
) (double
* data
, const size_t stride
, const size_t n
) {
12 av_push
(tempav
, newSVnv
((double
) $
1[i
]));
16 $result
= sv_2mortal
( newRV_noinc
( (SV
*) tempav
) );
17 //Perl_sv_dump
($result
);
21 %apply double
* { double
*data
};
24 #include
"gsl/gsl_nan.h"
25 #include
"gsl/gsl_sort.h"
26 #include
"gsl/gsl_sort_double.h"
27 #include
"gsl/gsl_sort_int.h"
28 #include
"gsl/gsl_sort_vector.h"
29 #include
"gsl/gsl_sort_vector_double.h"
30 #include
"gsl/gsl_sort_vector_int.h"
32 %include
"gsl/gsl_nan.h"
33 %include
"gsl/gsl_sort.h"
34 %include
"gsl/gsl_sort_double.h"
35 %include
"gsl/gsl_sort_int.h"
36 %include
"gsl/gsl_sort_vector.h"
37 %include
"gsl/gsl_sort_vector_double.h"
38 %include
"gsl/gsl_sort_vector_int.h"
43 gsl_sort gsl_sort_index
44 gsl_sort_smallest gsl_sort_smallest_index
45 gsl_sort_largest gsl_sort_largest_index
48 gsl_sort_vector gsl_sort_vector_index
49 gsl_sort_vector_smallest gsl_sort_vector_smallest_index
50 gsl_sort_vector_largest gsl_sort_vector_largest_index
52 @EXPORT_OK
= ( @EXPORT_plain
, @EXPORT_vector
);
54 all
=> [ @EXPORT_OK
],
55 plain
=> [ @EXPORT_plain
],
56 vector
=> [ @EXPORT_vector
],
62 Math
::GSL
::Sort
- Functions for sorting data
66 use Math
::GSL
::Sort qw
/:all
/;
67 my $x
= [ 2**15, 1.67, 20e5
,
68 -17, 6900, 1/3 , 42e-10 ];
69 my $sorted
= gsl_sort
($x
, 1, $#$x
+1 );
74 Here is a list of all the functions included in this module
:
78 =item gsl_sort_vector
($v
) - This function sorts the elements of the vector v into ascending numerical order.
80 =item gsl_sort_vector_index
82 =item gsl_sort_vector_smallest
84 =item gsl_sort_vector_smallest_index
86 =item gsl_sort_vector_largest
88 =item gsl_sort_vector_largest_index
94 =item gsl_sort_smallest
96 =item gsl_sort_smallest_index
98 =item gsl_sort_largest
100 =item gsl_sort_largest_index
104 You have to add the functions you want to use inside the qw
/put_funtion_here
/.
105 You can also write use Math
::GSL
::Sort qw
/:all
/ to use all avaible functions of the module.
106 Other tags are also avaible
, here is a complete list of all tags for this module
:
118 For more informations on the functions
, we refer you to the GSL offcial documentation
: http
://www.gnu.org
/software
/gsl
/manual
/html_node
/
119 Tip
: search on google
: site
:http
://www.gnu.org
/software
/gsl
/manual
/html_node
/ name_of_the_function_you_want
125 Jonathan Leto
<jonathan@leto.net
> and Thierry Moisan
<thierry.moisan@gmail.com
>
127 =head1 COPYRIGHT
AND LICENSE
129 Copyright
(C
) 2008 Jonathan Leto and Thierry Moisan
131 This program is free software
; you can redistribute it and
/or modify it
132 under the same terms as Perl itself.