[mathicgb] 283/393: Another order bites the dust.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:20 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 f896a6985652242f7cedb364dd35e99d884c6e04
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Thu Apr 18 17:13:04 2013 -0400

    Another order bites the dust.
---
 src/cli/SigGBAction.cpp          |  2 +-
 src/mathicgb/FreeModuleOrder.cpp | 10 +++++-----
 src/mathicgb/SignatureGB.cpp     | 12 ++++++++----
 src/test/FreeModuleOrderTest.cpp |  6 +++---
 src/test/gb-test.cpp             |  2 +-
 5 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/cli/SigGBAction.cpp b/src/cli/SigGBAction.cpp
index 04da797..6addb10 100755
--- a/src/cli/SigGBAction.cpp
+++ b/src/cli/SigGBAction.cpp
@@ -57,7 +57,7 @@ void SigGBAction::performAction() {
     ideal = Ideal::parse(inputFile);
   }
   std::unique_ptr<PolyRing const> ring(&(ideal->ring()));
-  if (mModuleOrder.value() == 2)
+  if (mModuleOrder.value() == 2 || mModuleOrder.value() == 4)
     ideal->reverse();
 
   SignatureGB alg(
diff --git a/src/mathicgb/FreeModuleOrder.cpp b/src/mathicgb/FreeModuleOrder.cpp
index fdd3cfb..0bdf853 100755
--- a/src/mathicgb/FreeModuleOrder.cpp
+++ b/src/mathicgb/FreeModuleOrder.cpp
@@ -689,10 +689,10 @@ void FreeModuleOrder::displayOrderTypes(std::ostream &o)
 {
   o << "FreeModule orders:" << std::endl;
   o << "  1   GrevLex IndexDown" << std::endl;
-  o << "  2   DegreeUp IndexUp GrevLex" << std::endl;
+  o << "  2   DegreeUp IndexUp GrevLex" << std::endl; // done
   o << "  3   DegreeUp IndexDown GrevLex" << std::endl;
-  o << "  4   SchreyerGrevLexUp" << std::endl;
-  o << "  5   SchreyerGrevLexDown" << std::endl;
+  o << "  4   SchreyerGrevLexUp" << std::endl; // done
+  o << "  5   SchreyerGrevLexDown" << std::endl; // done
   o << "  6   IndexUp SchreyerGrevLex" << std::endl;
   o << "  7   IndexDown SchreyerGrevLex" << std::endl;
 }
@@ -703,6 +703,8 @@ std::unique_ptr<FreeModuleOrder> FreeModuleOrder::makeOrder(FreeModuleOrderType
     type = 1;  // Set the default
 
   switch (type) {
+  case 4:
+    //return make_unique<ConcreteOrder<OrderD>>(OrderD(I, true));
   case 5:
     //return make_unique<ConcreteOrder<OrderD>>(OrderD(I, false));
   case 1:
@@ -712,8 +714,6 @@ std::unique_ptr<FreeModuleOrder> FreeModuleOrder::makeOrder(FreeModuleOrderType
     //return make_unique<ConcreteOrder<OrderB>>(OrderB(I));
   case 3:
    return make_unique<ConcreteOrder<OrderC>>(OrderC(I));
-  case 4:
-    return make_unique<ConcreteOrder<OrderD>>(OrderD(I, true));
   case 6:
     return make_unique<ConcreteOrder<OrderE>>(OrderE(I, true));
   case 7:
diff --git a/src/mathicgb/SignatureGB.cpp b/src/mathicgb/SignatureGB.cpp
index e892a0d..ead30e9 100755
--- a/src/mathicgb/SignatureGB.cpp
+++ b/src/mathicgb/SignatureGB.cpp
@@ -43,13 +43,16 @@ SignatureGB::SignatureGB(
   Hsyz2(MonomialTableArray::make(R, montable_type, ideal.size(), !mPostponeKoszul)),
   reducer(Reducer::makeReducer(reductiontyp, *R)),
   SP(make_unique<SigSPairs>(R, F.get(), GB.get(), Hsyz.get(), reducer.get(), mPostponeKoszul, mUseBaseDivisors, useSingularCriterionEarly, queueType)),
-  mReverseComponents(typ == 2),
+  mReverseComponents(typ == 2 || typ == 4),
   mComponentCount(ideal.size())
 {
   // Populate GB
   for (size_t j = 0; j < ideal.size(); j++)
     GB->addComponent();
 
+  if (typ == 5 || typ == 4)
+    mSchreyerTerms.resize(ideal.size());
+
   for (size_t j = 0; j < ideal.size(); j++) {
     int i = !mReverseComponents ? j : ideal.size() - 1 - j;
 
@@ -60,10 +63,10 @@ SignatureGB::SignatureGB(
     monomial sig = 0;
     sig = R->allocMonomial();
     R->monomialEi(i, sig);
-    if (typ == 5) {
+    if (typ == 5 || typ == 4) {
       auto lead = R->allocMonomial();
       R->monomialCopy(g->getLeadMonomial(), lead);
-      mSchreyerTerms.push_back(lead);
+      mSchreyerTerms[i] = lead;
       R->monomialMult(sig, g->getLeadMonomial(), sig);
     }
     {
@@ -141,8 +144,9 @@ void SignatureGB::computeGrobnerBasis()
       auto sig = R->allocMonomial();
       R->monomialCopy(v[i], sig);
       auto c = R->monomialGetComponent(sig);
+      MATHICGB_ASSERT(c < mComponentCount);
       if (!mSchreyerTerms.empty()) {
-        MATHICGB_ASSERT(c < mSchreyerTerms.size());
+        MATHICGB_ASSERT(mComponentCount == mSchreyerTerms.size());
         R->monomialDivide(sig, mSchreyerTerms[c], sig);
       }
       if (mReverseComponents)
diff --git a/src/test/FreeModuleOrderTest.cpp b/src/test/FreeModuleOrderTest.cpp
index 10e7f15..0c7d019 100755
--- a/src/test/FreeModuleOrderTest.cpp
+++ b/src/test/FreeModuleOrderTest.cpp
@@ -85,10 +85,10 @@ TEST(FreeModuleOrder, One) {
     "ac<1>\n"
     "bc<1>\n"
     "ab2c<2>\n";
-  
+
   runTest(ideal, sigs, "0 1 6 4 5 3 7 2", 1);
   //runTest(ideal, sigs, "0 6 5 1 4 3 7 2", 2); 
   runTest(ideal, sigs, "0 6 5 1 7 4 3 2", 3); 
-  runTest(ideal, sigs, "0 6 5 1 4 3 7 2", 4); 
-//  runTest(ideal, sigs, "0 6 5 1 4 7 3 2", 5); 
+  //runTest(ideal, sigs, "0 6 5 1 4 3 7 2", 4); 
+  //runTest(ideal, sigs, "0 6 5 1 4 7 3 2", 5); 
 }
diff --git a/src/test/gb-test.cpp b/src/test/gb-test.cpp
index 6c5ca74..56e632f 100755
--- a/src/test/gb-test.cpp
+++ b/src/test/gb-test.cpp
@@ -307,7 +307,7 @@ spairQueue	reducerType	divLookup	monTable	buchberger	postponeKoszul	useBaseDivis
         << reducerType << ' ' << divLookup << ' '
         << monTable << ' ' << postponeKoszul << ' ' << useBaseDivisors;
     } else {
-      if (freeModuleOrder == 2)
+      if (freeModuleOrder == 2 || freeModuleOrder == 4)
         I->reverse();
      SignatureGB basis
         (*I, freeModuleOrder, Reducer::reducerType(reducerType),

-- 
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