Jonathan Leto > Math-GSL-0.11_01 > Math::GSL::Sort

Download:
Math-GSL-0.11_01.tar.gz

Annotate this POD

CPAN RT

New  4
Open  5
View Bugs
Report a bug
Source   Latest Release: Math-GSL-0.20

NAME ^

Math::GSL::Sort - Functions for sorting data

SYNOPSIS ^

    use Math::GSL::Sort qw/:all/;
    my $x      = [ 2**15, 1.67, 20e5, 
                    -17, 6900, 1/3 , 42e-10 ];
    my $sorted = gsl_sort($x, 1, $#$x+1 );
    my $array = [2,3];
    my ($status, $smallest) = gsl_sort_smallest($array, 2, $x, 1, $#$x+1);

DESCRIPTION ^

Here is a list of all the functions included in this module :

 You have to add the functions you want to use inside the qw /put_funtion_here /. 
 You can also write use Math::GSL::Sort qw/:all/ to use all avaible functions of the module. 
 Other tags are also avaible, here is a complete list of all tags for this module :
all
plain
vector

For more informations on the functions, we refer you to the GSL offcial documentation: http://www.gnu.org/software/gsl/manual/html_node/

Tip : search on google: site:http://www.gnu.org/software/gsl/manual/html_node/ name_of_the_function_you_want

PERFORMANCE ^

In the source code of Math::GSL, the file "examples/benchmark/sort" compares the performance of gsl_sort() to Perl's builtin sort() function. It's first argument is the number of iterations and the second is the size of the array of numbers to sort. For example, to see a benchmark of 1000 iterations for arrays of size 50000 you would type

    ./examples/benchmark/sort 1000 50000

Initial benchmarks indicate just slightly above a 2x performance increase over sort() for arrays of between 5000 and 50000 elements. This may mostly be due to the fact that gsl_sort() takes and returns a reference while sort() takes and returns a plain list.

AUTHORS ^

Jonathan Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008 Jonathan Leto and Thierry Moisan

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.