[mathicgb] 255/393: Added elimination order GB test for the library interface

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:14 UTC 2015


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

dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.

commit 3dab3556bb0c755db6225c288360b4970e2a3e20
Author: Mike Stillman <mikestillman1 at gmail.com>
Date:   Tue Apr 16 11:42:59 2013 -0400

    Added elimination order GB test for the library interface
---
 src/test/mathicgb.cpp | 47 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/src/test/mathicgb.cpp b/src/test/mathicgb.cpp
index c5076f0..f993354 100755
--- a/src/test/mathicgb.cpp
+++ b/src/test/mathicgb.cpp
@@ -182,6 +182,31 @@ namespace {
     s.appendPolynomialDone();
     s.idealDone();
   }
+
+  template<class Stream>
+  void makeSimpleIdeal(Stream& s) { // variables a,b,c,d.  a2-bc, ab-cd.
+    s.idealBegin();
+      s.appendPolynomialBegin(); // a^2-b*c
+        s.appendTermBegin();
+          s.appendExponent(0,2);
+        s.appendTermDone(1);
+        s.appendTermBegin();
+          s.appendExponent(1,1);
+          s.appendExponent(2,1);
+        s.appendTermDone(s.modulus() - 1);
+      s.appendPolynomialDone();
+      s.appendPolynomialBegin(2); // a*b-c*d
+        s.appendTermBegin();
+          s.appendExponent(0,1);
+          s.appendExponent(1,1);
+        s.appendTermDone(1);
+        s.appendTermBegin();
+          s.appendExponent(2,1);
+          s.appendExponent(3,1);
+        s.appendTermDone(s.modulus() - 1);
+      s.appendPolynomialDone();
+    s.idealDone();
+  }
 }
 
 TEST(MathicGBLib, NullIdealStream) {
@@ -380,3 +405,25 @@ TEST(MathicGBLib, Cyclic5) {
     mgb::computeGroebnerBasis(input, computed);
   }
 }
+
+TEST(MathicGBLib, SimpleEliminationGB) {
+  std::vector<mgb::GroebnerConfiguration::Exponent> gradings = {1,0,0,0,  1,1,1,1};
+  for (int i = 0; i < 2; ++i) {
+    mgb::GroebnerConfiguration configuration(101, 4);
+    const auto reducer = i == 0 ?
+      mgb::GroebnerConfiguration::ClassicReducer :
+      mgb::GroebnerConfiguration::MatrixReducer;
+    configuration.setReducer(reducer);
+    configuration.setMonomialOrder(
+      mgb::GroebnerConfiguration::BaseOrder::ReverseLexicographicBaseOrder, 
+      gradings
+    );
+    mgb::GroebnerInputIdealStream input(configuration);
+    makeSimpleIdeal(input);
+
+    mgb::NullIdealStream computed(input.modulus(), input.varCount());
+
+    mgb::computeGroebnerBasis(input, computed);
+  }
+}
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git



More information about the debian-science-commits mailing list