r1268 - in packages/libmath-combinatorics-perl/trunk: . debian
lib/Math
Carlo Segre
segre-guest at costa.debian.org
Fri Jul 22 06:08:54 UTC 2005
Author: segre-guest
Date: 2005-07-22 06:08:52 +0000 (Fri, 22 Jul 2005)
New Revision: 1268
Modified:
packages/libmath-combinatorics-perl/trunk/README
packages/libmath-combinatorics-perl/trunk/debian/changelog
packages/libmath-combinatorics-perl/trunk/debian/copyright
packages/libmath-combinatorics-perl/trunk/lib/Math/Combinatorics.pm
Log:
copyright now in package, new version of main module
Modified: packages/libmath-combinatorics-perl/trunk/README
===================================================================
--- packages/libmath-combinatorics-perl/trunk/README 2005-07-21 13:39:13 UTC (rev 1267)
+++ packages/libmath-combinatorics-perl/trunk/README 2005-07-22 06:08:52 UTC (rev 1268)
@@ -104,3 +104,8 @@
For bug reports: Ying Yang, Joerg Beyer, Marc Logghe
+LICENSE AND COPYRIGHT
+
+ Copyright (c) 2004 Allen Day. All rights reserved. This program is
+ free software; you can redistribute it and/or modify it under the same
+ terms as Perl itself.
Modified: packages/libmath-combinatorics-perl/trunk/debian/changelog
===================================================================
--- packages/libmath-combinatorics-perl/trunk/debian/changelog 2005-07-21 13:39:13 UTC (rev 1267)
+++ packages/libmath-combinatorics-perl/trunk/debian/changelog 2005-07-22 06:08:52 UTC (rev 1268)
@@ -1,3 +1,9 @@
+libmath-combinatorics-perl (0.05-1) unstable; urgency=low
+
+ * New upstream release
+
+ -- Carlo Segre <segre at iit.edu> Thu, 21 Jul 2005 08:39:33 -0500
+
libmath-combinatorics-perl (0.04-1) unstable; urgency=low
* Initial Release (Closes: #309574)
Modified: packages/libmath-combinatorics-perl/trunk/debian/copyright
===================================================================
--- packages/libmath-combinatorics-perl/trunk/debian/copyright 2005-07-21 13:39:13 UTC (rev 1267)
+++ packages/libmath-combinatorics-perl/trunk/debian/copyright 2005-07-22 06:08:52 UTC (rev 1268)
@@ -5,46 +5,6 @@
Upstream Author: Allen Day <allenday at ucla.edu>
-The following copyright statement was approved by the author in an email dated
-May 2, 2005. The full text is attached below.
-
-Copyright (c) 2004 Allen Day. All rights reserved. This program is
-free software; you can redistribute it and/or modify it under the same terms
-as Perl itself.
-
-On Debian GNU/Linux systems, the complete text of these licenses can be found
-in /usr/share/common-licenses/GPL and /usr/share/common-licenses/Artistic.
-
-----------------------------------------------------------------------------
-
-Date: Mon, 02 May 2005 13:12:29 -0700 (PDT)
-From: Allen Day <allenday at ucla.edu>
-To: Carlo Segre <segre at iit.edu>
-Subject: Re: copyright for Math::Combinatorics
-
-Yes, that's fine. Out of curiousity, why are you packaging this? Is it
-depended on by another package, or just generally useful?
-
--Allen
-
-
-On Mon, 2 May 2005, Carlo Segre wrote:
-
->
-> Dear Dr. Day:
->
-> I am planning to package your Perl module Math::Combinatorics for the
-> Debian Linux distribution. I could not find a Copyright notice so I
-> wonder if you would consider using the one below. It is commonly used in
-> Perl modules and would permit me to make the module part of the "main"
-> Debian archive.
->
-> Cheers,
-> Carlo
->
-> -------------------
-> Copyright (c) 2004 Allen Day. All rights reserved. This program is free
-> software; you can redistribute it and/or modify it under the same terms as
-> Perl itself.
->
->
+Copyright (c) 2004 Allen Day. All rights reserved. This program is free
+software; you can redistribute it and/or modify it under the same terms as
+Perl itself.
Modified: packages/libmath-combinatorics-perl/trunk/lib/Math/Combinatorics.pm
===================================================================
--- packages/libmath-combinatorics-perl/trunk/lib/Math/Combinatorics.pm 2005-07-21 13:39:13 UTC (rev 1267)
+++ packages/libmath-combinatorics-perl/trunk/lib/Math/Combinatorics.pm 2005-07-22 06:08:52 UTC (rev 1268)
@@ -21,7 +21,7 @@
print "\n";
- print "combinations of 2 from: ".join(" ", at n)."\n";
+ print "permutations of 3 from: ".join(" ", at n)."\n";
print "------------------------".("--" x scalar(@n))."\n";
while(my @permu = $combinat->next_permutation){
print join(' ', @permu)."\n";
@@ -51,7 +51,7 @@
a c
b c
- combinations of 2 from: a b c
+ permutations of 3 from: a b c
------------------------------
a b c
a c b
@@ -75,21 +75,50 @@
permutation, and factorial, respectively). Functional and object-oriented usages allow
problems such as the following to be solved:
-nCk "Fun questions to ask the pizza parlor wait staff: how many possible combinations
+=over
+
+=item nCk
+
+"Fun questions to ask the pizza parlor wait staff: how many possible combinations
of 2 toppings can I get on my pizza?".
-nPk "Master Mind Game: ways to arrange pieces of different colors in a
-certain number of positions, without repetition of a color".
+=item nPk
+"Master Mind Game: ways to arrange pieces of different colors in a
+ certain number of positions, without repetition of a color".
+
+=back
+
Object-oriented usage additionally allows solving these problems by calling L</new()>
with a B<frequency> vector:
-nPRk "morse signals: diferent signals of 3 positions using the 2 two symbol - and .".
+=over
-nCRk "ways to extract 3 balls at once of a bag with black and white balls".
+=item nPRk
-nPRk "different words obtained permuting the letters of the word PARROT".
+"morse signals: diferent signals of 3 positions using the 2 two symbol - and .".
+ my $c = Math::Combinatorics->new(
+ count => 3,
+ data => ['a','b'],
+ frequency => [3,3],
+ );
+
+ while (my @x = $c->next_combination) {
+ my $d = Math::Combinatorics->new( data => \@x );
+ while (my @y = $d->next_permutation) {
+ print "@y\n";
+ }
+ }
+
+"different words obtained permuting the letters of the word PARROT".
+
+=item nCRk
+
+"ways to extract 3 balls at once of a bag with black and white balls".
+
+=back
+
=head2 EXPORT
the following export tags will bring a single method into the caller's
@@ -105,6 +134,9 @@
Allen Day <allenday at ucla.edu>, with algorithmic contributions from Christopher Eltschka and
Tye.
+Copyright (c) 2004-2005 Allen Day. All rights reserved. This program is free software; you
+can redistribute it and/or modify it under the same terms as Perl itself.
+
=head1 ACKNOWLEDGEMENTS
Thanks to everyone for helping to make this a better module.
@@ -113,19 +145,27 @@
For bug reports: Ying Yang, Joerg Beyer, Marc Logghe
-=head1 BUGS
+=head1 BUGS / TODO
-report them to the author. a known bug (partial implementation bug) does not allow
-parameterization of k for nPk in permute(). it is assumed k == n. L</permute()> for
-details.
+Report them to the author.
+* A known bug (more of a missing feature, actually) does not allow parameterization of k
+for nPk in permute(). it is assumed k == n. L</permute()> for details. You can work
+around this by making calls to both L</permute()> and L</combine()>
+
+* No implementation of Stirling Numbers of the Second Kind, or Bell Numbers.
+
+http://mathworld.wolfram.com/StirlingNumberoftheSecondKind.html
+
+http://mathworld.wolfram.com/BellNumber.html
+
=head1 SEE ALSO
L<Set::Scalar>
L<Set::Bag>
-L<String::Combination> (misnamed, it actually returns permutations on a string).
+L<String::Combination> (alas misnamed, it actually returns permutations on a string).
http://perlmonks.thepen.com/29374.html
@@ -140,7 +180,7 @@
our @ISA = qw(Exporter);
our @EXPORT = qw( combine permute factorial);
-our $VERSION = '0.04';
+our $VERSION = '0.05';
=head1 EXPORTED FUNCTIONS
More information about the Pkg-perl-cvs-commits
mailing list