Algorithm-Networksort
view release on metacpan or search on metacpan
even if it is for bubble sort.
Tue Oct 2 2012
- Added a new test, svg.t. It is modeled on pod.t, and uses
Test::XML::Easy. If I had had it as part of the tests
before, I wouldn't have let the badly merged code in the
earlier versions get released.
1.22
Sun Sep 30 2012
- Something odd happened to the SVG code post version 1.08,
leading to unparsable output (could be the result of the
hardware failure, could be merge error on my part).
Took the SVG graph code from version 1.08, and re-applied
the changes to the graph code between then and version 1.21.
The graphs come out correctly now.
Fri Sep 28 2012
- Took horizontal and vertical coord code out of nw_eps_graph()
and nw_svg_graph(), and made them into their own functions.
- I really had an odd style for initializing variables from @_
back in 2003. Made it less odd.
- Small inefficiency with the column count in nw_text_graph() fixed.
1.21
Tue Jan 31 2012
- Perl version requirement changed to 5.8.3 (from 5.6.0). Support
for 5.6.0 in various perl development tools is being dropped,
and 5.8.3 seems to be a safe minimum, at least for the current
year. Change made in Build.PL and Networksort.pm.
- Changed "repository" key in Build.PL from a hash to a string,
as seems to be currently required under the version of
Module::Build that I'm developing with (the hash form looks
to be for a later version that I cannot install yet).
Tue Jan 11 2011
- Found an error in the SYNOPSIS portion of the POD. Function
nw_format() had an incorrect argument.
Thu Sep 23 2010
- Experimented by adding a 'keywords' hash to Build.PL. We'll see if I
did it correctly.
Wed Sep 15 2010
- Update the references. Joe Celko's article in dbazine.com is gone
(dbazine.com seems to be under new ownership), but he used the
same material in the third edition of his book, so I refer to
that now. Dr. Batcher's web site at Kent State has changed slightly,
making a change in the links necessary.
in fact "parallelize" the comparators so that they'll look nice on the
graph). So there's now an option to re-group the list. It's not the
default because the default behavior has been there since the beginning
of the module.
See the documentation for nw_comparator() for more information.
- Undid use of mark attributes for SVG graphing. Too many inconsistencies
between different SVG viewers for me to be sure that I'm doing the right
thing.
- While undoing that change, simplified the code that generates the
group/color attributes. I decided that individually assigning the
color attribute to each element was probably a less error-prone mechanism.
- Updated svg.pl and eps.pl in the eg directory to make use of the
color options.
- Fixed the nw_group() example. It was using the default 'bosenelson'
algorithm, but the output was from the 'batcher' algorithm. Oops.
- Added grouping.pl to the eg directory.
Wed Feb 10 2010
- Changed <svg> tag adding xmlns and viewBox attributes.
* Change input and comparator lines to use mark attributes instead
of separate geometric circles.
- Added nw_algorithms() and nw_algorithm_name() functions, and documented
them.
- Updated the SVG output example and demo program in the eg directory.
1.07 Tue Feb 13 2007
- Bowed to convention and reversed the order of the Change entries.
- SVG-aware browsers are better at parsing, which means that my
output needs to be improved. Internet Explorer 7 and Firefox
now parse without errors. I am not certain that the namespace
option works well enough.
- Changed the example that used the SVG output, which was based on
an older version of the Adobe SVG plugin, and which is not current.
- In the interests of code clarity, made use of q and qq operators
instead of quotes and escaped quotes.
- Split the test files even further.
- SVG colors!
- Embedded the [from, to] pairs in an xml comment before each svg
command to draw comparators. Debugging aid.
- Put a group tag around the SVG commands for the input line.
although you'd be waiting a long time for a result.
- Fixed L<> tags in the documentation.
- In the eg directory, renamed svg.pl to svg00.pl, and added
svg01.pl for the XHTML version.
1.04 Sun Dec 14 2003
- Added 'namespace' to the svg graphing options. Added
it to the svg.pl script in the eg subdirectory.
1.03 Sat Dec 13 2003
- Added 'title' to the eps and svg graphing options.
1.02 Tue Dec 9 2003
- Little document formating errors bother me.
- Another stupid error. Function nw_text_graph(), used
by nw_graph(), was printing directly, not returning a
string. It's an old function, that's how it originally
was designed.
- Added the graphing options (hz_margin, indent, etc.)
to nw_graph().
- Merged in the nw_group_parallel() function (moved from
parallel.pl in the eg subdirectory) into nw_group(),
fairly painlessly as it turned out.
1.01 Sat Oct 25 2003
- Stupid error in my test scripts prevented them from
reading the zero_one.pl file. Fixed.
1.00 Fri Oct 17 2003
- Released.
0.01 Fri Jan 24 23:55:59 2003
- original version; created by h2xs 1.21 with options
-X -nAlgorithm::Networksort
lib/Algorithm/Networksort.pm view on Meta::CPAN
sub BUILD
{
my $self = shift;
my $alg = $self->algorithm();
my $inputs = $self->inputs();
my @network;
my @grouped;
#
# Catch errors
#
croak "Input size must be 2 or greater" if ($inputs < 2);
#
# Providing our own-grown network?
#
if ($alg eq 'none')
{
croak "No comparators provided" unless ($self->has_comparators);
$self->length(scalar @{ $self->comparators });
lib/Algorithm/Networksort.pm view on Meta::CPAN
1;
__END__
=head1 ACKNOWLEDGMENTS
L<Doug Hoyte|https://github.com/hoytech> provided the code for the bitonic,
odd-even merge, odd-even transposition, balanced, and bubble sort algorithms,
and the idea for what became the L<statistics()> method.
L<Morwenn|https://github.com/Morwenn> found documentation errors and networks
that went into L<Algorithm::Networksort::Best>.
=head1 SEE ALSO
=head2 Bose and Nelson's algorithm.
=over 3
=item
lib/Algorithm/Networksort/Best.pm view on Meta::CPAN
1;
__END__
=head1 ACKNOWLEDGMENTS
L<Doug Hoyte|https://github.com/hoytech> pointed out Sherenaz Waleed
Al-Haj Baddar's paper.
L<Morwenn|https://github.com/Morwenn> found for me the SAT and SENSO
papers, contributed 23-input and 24-input sorting networks, and caught
documentation errors.
=head1 SEE ALSO
=head2 Non-algorithmic discoveries
=over 3
=item
The networks by Floyd, Green, Shapiro, and Waksman are in
( run in 0.634 second using v1.01-cache-2.11-cpan-65fba6d93b7 )