Algorithm-Bitonic-Sort

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
use utf8;
use 5.006;
use strict;
 
WriteMakefile(
        NAME                => 'Algorithm::Bitonic::Sort',
        AUTHOR              => q{BlueT - Matthew Lien - 練喆明 <BlueT@BlueT.org>},
        VERSION_FROM        => 'lib/Algorithm/Bitonic/Sort.pm',
        ABSTRACT_FROM       => 'lib/Algorithm/Bitonic/Sort.pm',

lib/Algorithm/Bitonic/Sort.pm  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
use utf8;
use feature 'say';
use constant DEBUG => $ENV{ALGORITHM_BITONIC_SORT_DEBUG};
 
if (DEBUG) {
        require Data::Dumper::Simple;
}
 
our (@ISA, @EXPORT);
BEGIN {
        require Exporter;
        @ISA = qw(Exporter);
        @EXPORT = qw(bitonic_sort)# symbols to export on request
}
 
# "A supercomputer is a device for turning compute-bound problems into I/O-bound problems."
 
=encoding utf8
 
=head1 NAME
 
Algorithm::Bitonic::Sort - Sorting numbers with Bitonic Sort
 
=head1 VERSION
 
Version 0.06
 
=cut

t/01-sort.t  view on Meta::CPAN

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!perl
 
use 5.10.1;
use utf8;
use Test::Simple tests => 2;
 
         
my @sample = (1,5,8,4,4365,2,67,33,345);
my @up = (1,2,4,5,8,33,67,345,4365);
my @down = (4365,345,67,33,8,5,4,2,1);
 
my @result = bitonic_sort( 1 ,@sample);



( run in 1.040 second using v1.01-cache-2.11-cpan-49f99fa48dc )