Algorithm-Bitonic-Sort

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN

use utf8;
use 5.006;
use strict;
use warnings;
use ExtUtils::MakeMaker;

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

package Algorithm::Bitonic::Sort;

use utf8;
use feature 'say';
use common::sense;
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

#!perl

use 5.10.1;
use utf8;
use common::sense;
use Test::Simple tests => 2;

use Algorithm::Bitonic::Sort;
	
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.380 second using v1.01-cache-2.11-cpan-49f99fa48dc )