Further refactoring of the Sort typemaps.
[Math-GSL.git] / Sort.i
blobdf7c6960e010aade532c77a1c45bf814c46154a8
1 %module "Math::GSL::Sort"
2 /* Danger Will Robinson! */
4 %include "typemaps.i"
5 %include "gsl_typemaps.i"
7 %typemap(argout) (double * data, const size_t stride, const size_t n) {
8 int i=0;
9 AV* tempav = newAV();
11 while( i < $3 ) {
12 av_push(tempav, newSVnv((double) $1[i]));
13 i++;
16 $result = sv_2mortal( newRV_noinc( (SV*) tempav) );
17 //Perl_sv_dump($result);
18 argvi++;
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"
41 %perlcode %{
42 @EXPORT_plain = qw/
43 gsl_sort gsl_sort_index
44 gsl_sort_smallest gsl_sort_smallest_index
45 gsl_sort_largest gsl_sort_largest_index
47 @EXPORT_vector= qw/
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 );
53 %EXPORT_TAGS = (
54 all => [ @EXPORT_OK ],
55 plain => [ @EXPORT_plain ],
56 vector => [ @EXPORT_vector ],
58 __END__
60 =head1 NAME
62 Math::GSL::Sort - Functions for sorting data
64 =head1 SYNOPSIS
66 use Math::GSL::Sort qw/:all/;
68 =head1 DESCRIPTION
70 Here is a list of all the functions included in this module :
72 =over
74 =item gsl_sort_vector($v) - This function sorts the elements of the vector v into ascending numerical order.
76 =item gsl_sort_vector_index
78 =item gsl_sort_vector_smallest
80 =item gsl_sort_vector_smallest_index
82 =item gsl_sort_vector_largest
84 =item gsl_sort_vector_largest_index
86 =item gsl_sort
88 =item gsl_sort_index
90 =item gsl_sort_smallest
92 =item gsl_sort_smallest_index
94 =item gsl_sort_largest
96 =item gsl_sort_largest_index
98 =back
100 You have to add the functions you want to use inside the qw /put_funtion_here /.
101 You can also write use Math::GSL::Sort qw/:all/ to use all avaible functions of the module.
102 Other tags are also avaible, here is a complete list of all tags for this module :
104 =over
106 =item all
108 =item plain
110 =item vector
112 =back
114 For more informations on the functions, we refer you to the GSL offcial documentation: http://www.gnu.org/software/gsl/manual/html_node/
115 Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want
117 =head1 EXAMPLES
119 =head1 AUTHORS
121 Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>
123 =head1 COPYRIGHT AND LICENSE
125 Copyright (C) 2008 Jonathan Leto and Thierry Moisan
127 This program is free software; you can redistribute it and/or modify it
128 under the same terms as Perl itself.
130 =cut