Algorithm-Networksort

 view release on metacpan or  search on metacpan

lib/Algorithm/Networksort.pm  view on Meta::CPAN

package Algorithm::Networksort;

use 5.010001;

use Moose;
use Moose::Exporter;
use namespace::autoclean;

use Carp;

#
# Three # for "I am here" messages,
# four # for (non-array) variable dumps,
# five # for array dumps and sort tracking.
#
#use Smart::Comments ('###');

#
# Export a couple of convenience functions:
# nwsrt(), which is shorthand for Algorithm::Networksort->new();
# and algorithms(), which gives a list of algorithm keys.
#
Moose::Exporter->setup_import_methods(
	as_is => [\&nwsrt_algorithms, \&nwsrt_title, \&nwsrt],
);

our $VERSION = '2.02';

#
# Our one use of overload, because default
# printing is useful.
#
use overload
	'""'	=> \&_stringify;

#
# Names for the algorithm keys.
#
my %algname = (
	balanced => "Balanced",
	batcher => "Batcher's Mergesort",
	bitonic => "Bitonic Sort",
	bosenelson => "Bose-Nelson Sort",
	bubble => "Bubble Sort",
	hibbard => "Hibbard's Sort",
	oddeventrans => "Odd-Even Transposition Sort",
	oddevenmerge => "Batcher's Odd-Even Merge Sort",
);

#
# Default parameters for SVG and EPS-based Knuth diagrams.
#
my %graphset = (
	hz_sep => 12,
	hz_margin => 18,
	vt_sep => 12,
	vt_margin => 21,
	indent => 9,
	inputradius => 2,
	compradius => 2,
	inputline => 2,
	compline => 2,
);

#
# Default parameters for text-based Knuth diagrams.
#



( run in 0.869 second using v1.01-cache-2.11-cpan-5a3173703d6 )