Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 7d8cc66

Added an example.

  • Participants
  • Parent commits b5b3c7e

Comments (0)

Files changed (2)

File modules/Math-GrahamFunction/MANIFEST

 Build.PL
 Changes
+examples/calc-graham.pl
 lib/Math/GrahamFunction/Object.pm
 lib/Math/GrahamFunction.pm
 lib/Math/GrahamFunction/SqFacts/Dipole.pm

File modules/Math-GrahamFunction/examples/calc-graham.pl

+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Math::GrahamFunction;
+
+my $n = shift;
+
+if (!defined($n))
+{
+    die "You must specify an argument.";
+}
+if ($n !~ /^\d+$/)
+{
+    die "Argument is not numeric.";
+}
+
+my $obj = Math::GrahamFunction->new({n => $n});
+
+my $values = $obj->solve();
+print map { "$_\n" } @{$values->{factors}};