Jonathan Leto > Math-GSL-0.27 > Math::GSL::Sort

Download:
Math-GSL-0.27.tar.gz

Dependencies

Annotate this POD

CPAN RT

New  8
Open  8
View/Report Bugs
Source   Latest Release: Math-GSL-0.34_1

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 $numbers = [ map { rand(100) } (1..100) ];
    my ($status, $smallest10) = gsl_sort_smallest($array, 10, $x, 1, $#$x+1);

DESCRIPTION ^

 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/

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 "Duke" Leto <jonathan@leto.net> and Thierry Moisan <thierry.moisan@gmail.com>

COPYRIGHT AND LICENSE ^

Copyright (C) 2008-2011 Jonathan "Duke" Leto and Thierry Moisan

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

syntax highlighting: