This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.41
in repository libmath-prime-util-perl.

commit da990118617be594acb4a4e3bda04424ecfaf82d
Author: Dana Jacobsen <d...@acm.org>
Date:   Tue May 13 22:18:02 2014 -0700

    Move some examples to vecsum from List::Util::sum
---
 examples/porter.pl            | 1 -
 examples/project_euler_037.pl | 3 +--
 xt/moebius-mertens.pl         | 7 +++----
 xt/totient-range.pl           | 9 +++------
 4 files changed, 7 insertions(+), 13 deletions(-)

diff --git a/examples/porter.pl b/examples/porter.pl
index 3401e74..a70775c 100755
--- a/examples/porter.pl
+++ b/examples/porter.pl
@@ -3,7 +3,6 @@ use warnings;
 use strict;
 use 5.14.0;
 use Math::Prime::Util qw/:all/;
-use List::Util qw/sum/;
 use Benchmark qw/:all/;
 
 my $lim = shift || 1000;
diff --git a/examples/project_euler_037.pl b/examples/project_euler_037.pl
index 034c569..9e4eb73 100644
--- a/examples/project_euler_037.pl
+++ b/examples/project_euler_037.pl
@@ -2,7 +2,6 @@
 use warnings;
 use strict;
 use Math::Prime::Util qw/:all/;
-use List::Util qw/sum/;
 
 my @tp;
 my $p = 7;
@@ -17,4 +16,4 @@ while (1) {
   push @tp, $p;
   last if scalar @tp >= 11;
 }
-print sum(@tp), "\n";
+print vecsum(@tp), "\n";
diff --git a/xt/moebius-mertens.pl b/xt/moebius-mertens.pl
index 295eea9..e8e3cf3 100755
--- a/xt/moebius-mertens.pl
+++ b/xt/moebius-mertens.pl
@@ -3,8 +3,7 @@ use strict;
 use warnings;
 $| = 1;  # fast pipes
 
-use Math::Prime::Util qw/moebius mertens/;
-use List::Util qw/sum/;
+use Math::Prime::Util qw/moebius mertens vecsum/;
 
 my $limit = shift || 1_000_000;
 
@@ -23,8 +22,8 @@ while (1) {
   my @mu_range = @mu[ $beg .. $end ];
   my @mobius = moebius($beg,$end);
 
-  my $mu_sum = sum(@mu_range);
-  my $mo_sum = sum(@mobius);
+  my $mu_sum = vecsum(@mu_range);
+  my $mo_sum = vecsum(@mobius);
   my $mert_sum = mertens($end) - mertens($beg-1);
   warn "\nbeg $beg  end $end  sum $mu_sum  range sum $mo_sum\n"
        unless $mu_sum == $mo_sum;
diff --git a/xt/totient-range.pl b/xt/totient-range.pl
index 035973b..c0d0240 100755
--- a/xt/totient-range.pl
+++ b/xt/totient-range.pl
@@ -3,8 +3,7 @@ use strict;
 use warnings;
 $| = 1;  # fast pipes
 
-use Math::Prime::Util qw/euler_phi/;
-use List::Util qw/sum/;
+use Math::Prime::Util qw/euler_phi vecsum/;
 
 my $limit = shift || 1_000_000;
 
@@ -21,11 +20,9 @@ while (1) {
   ($beg,$end) = ($end,$beg) if $beg > $end;
 
   # Does range return the same values?
-  my @phi_range = @phi[ $beg .. $end ];
-  my @totients = euler_phi($beg,$end);
+  my $sum1 = vecsum(  @phi[ $beg .. $end ]  );
+  my $sum2 = vecsum(  euler_phi($beg,$end)  );
 
-  my $sum1 = sum(@phi_range);
-  my $sum2 = sum(@totients);
   warn "\nbeg $beg  end $end  sum $sum1  range sum $sum2\n"
        unless $sum1 == $sum2;
   print ".";

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to