[mathicgb] 287/393: Turned the Schreyer part of all remaining orders into preprocessing.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:21 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 3c4cf87464751d25994003ca416599c2c1df3ca1
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Thu Apr 18 18:32:31 2013 -0400
Turned the Schreyer part of all remaining orders into preprocessing.
---
src/mathicgb/FreeModuleOrder.cpp | 32 ++++++++++++++++----------------
src/mathicgb/SignatureGB.cpp | 11 ++++++-----
src/mathicgb/SignatureGB.hpp | 3 ++-
src/test/FreeModuleOrderTest.cpp | 2 +-
4 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/src/mathicgb/FreeModuleOrder.cpp b/src/mathicgb/FreeModuleOrder.cpp
index 4e46de3..2b54d08 100755
--- a/src/mathicgb/FreeModuleOrder.cpp
+++ b/src/mathicgb/FreeModuleOrder.cpp
@@ -409,8 +409,8 @@ public:
void unscrambleSignature(monomial sig) const {}
int signatureCompare(const_monomial sig, const_monomial sig2) const {
- int da = - sig[topindex] + deg[*sig];
- int db = -sig2[topindex] + deg[*sig2];
+ int da = - sig[topindex];// + deg[*sig];
+ int db = -sig2[topindex];// + deg[*sig2];
if (da > db) return GT;
if (db > da) return LT;
int cmp = *sig - *sig2;
@@ -419,10 +419,10 @@ public:
auto a = sig;
auto b = sig2;
- const_monomial ma = monoms[*a];
- const_monomial mb = monoms[*b];
+// const_monomial ma = monoms[*a];
+ // const_monomial mb = monoms[*b];
for (size_t i = topindex; i >= 1; i--) {
- int cmp = a[i] - b[i] + ma[i] - mb[i];
+ int cmp = a[i] - b[i];// + ma[i] - mb[i];
if (cmp != 0)
return cmp < 0 ? GT : LT;
}
@@ -442,9 +442,9 @@ public:
const_monomial m2,
const_monomial sig2
) const {
- int da = - sig[topindex] + deg[*sig];
+ int da = - sig[topindex];// + deg[*sig];
int db = - m2[topindex];
- db += -sig2[topindex] + deg[*sig2];
+ db += -sig2[topindex];// + deg[*sig2];
if (da > db) return GT;
if (db > da) return LT;
int cmp = *sig - *sig2;
@@ -453,11 +453,11 @@ public:
auto a = sig;
auto b = sig2;
- const_monomial ma = monoms[*a];
- const_monomial mb = monoms[*b];
+// const_monomial ma = monoms[*a];
+ // const_monomial mb = monoms[*b];
for (size_t i = topindex; i >= 1; i--)
{
- int cmp = a[i] - b[i] + ma[i] - mb[i] - m2[i];
+ int cmp = a[i] - b[i]/* + ma[i] - mb[i]*/ - m2[i];
if (cmp < 0) return GT;
if (cmp > 0) return LT;
}
@@ -644,8 +644,8 @@ public:
void appendBasisElement(const_monomial m) {monoms.push_back(m);}
int signatureCompare(const_monomial a, const_monomial b) const {
- const_monomial ma = monoms[*a];
- const_monomial mb = monoms[*b];
+ //const_monomial ma = monoms[*a];
+ //const_monomial mb = monoms[*b];
if (*a != *b)
{
@@ -656,7 +656,7 @@ public:
}
for (size_t i = topindex; i >= 1; i--) {
- int cmp = a[i] - b[i] + ma[i] - mb[i];
+ int cmp = a[i] - b[i];// + ma[i] - mb[i];
if (cmp != 0)
return cmp < 0 ? GT : LT;
}
@@ -671,8 +671,8 @@ public:
void unscrambleSignature(monomial sig) const {}
int signatureCompare(const_monomial a, const_monomial m2, const_monomial b) const {
- const_monomial ma = monoms[*a];
- const_monomial mb = monoms[*b];
+ const_monomial ma;// = monoms[*a];
+ const_monomial mb;// = monoms[*b];
int cmp = *a - *b;
if (cmp != 0)
{
@@ -690,7 +690,7 @@ public:
for (size_t i = topindex; i >= 1; i--)
{
- int cmp = a[i] - b[i] + ma[i] - mb[i] - m2[i];
+ int cmp = a[i] - b[i]/* + ma[i] - mb[i]*/ - m2[i];
if (cmp < 0) return GT;
if (cmp > 0) return LT;
}
diff --git a/src/mathicgb/SignatureGB.cpp b/src/mathicgb/SignatureGB.cpp
index 122c419..2fc2afe 100755
--- a/src/mathicgb/SignatureGB.cpp
+++ b/src/mathicgb/SignatureGB.cpp
@@ -44,13 +44,14 @@ SignatureGB::SignatureGB(
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 || typ == 4 || typ == 6),
+ mDoSchreyer(typ == 5 || typ == 4 || typ == 3 || typ == 2 || typ == 6 || typ == 7),
mComponentCount(ideal.size())
{
// Populate GB
for (size_t j = 0; j < ideal.size(); j++)
GB->addComponent();
- if (typ == 5 || typ == 4)
+ if (mDoSchreyer)
mSchreyerTerms.resize(ideal.size());
for (size_t j = 0; j < ideal.size(); j++) {
@@ -63,7 +64,7 @@ SignatureGB::SignatureGB(
monomial sig = 0;
sig = R->allocMonomial();
R->monomialEi(i, sig);
- if (typ == 5 || typ == 4) {
+ if (mDoSchreyer) {
auto lead = R->allocMonomial();
R->monomialCopy(g->getLeadMonomial(), lead);
mSchreyerTerms[i] = lead;
@@ -133,11 +134,11 @@ void SignatureGB::computeGrobnerBasis()
stats_nsecs = mTimer.getMilliseconds() / 1000.0;
//GB->displayBrief(out);
- if (!mSchreyerTerms.empty())
+ if (mDoSchreyer)
GB->unschreyer(mSchreyerTerms);
if (mReverseComponents)
GB->reverseComponents(mComponentCount);
- if (!mSchreyerTerms.empty() || mReverseComponents) {
+ if (mDoSchreyer || mReverseComponents) {
std::vector<const_monomial> v;
Hsyz->getMonomials(v);
for (size_t i = 0; i < v.size(); ++i) {
@@ -145,7 +146,7 @@ void SignatureGB::computeGrobnerBasis()
R->monomialCopy(v[i], sig);
auto c = R->monomialGetComponent(sig);
MATHICGB_ASSERT(c < mComponentCount);
- if (!mSchreyerTerms.empty()) {
+ if (mDoSchreyer) {
MATHICGB_ASSERT(mComponentCount == mSchreyerTerms.size());
R->monomialDivide(sig, mSchreyerTerms[c], sig);
}
diff --git a/src/mathicgb/SignatureGB.hpp b/src/mathicgb/SignatureGB.hpp
index efc9f7e..647c56a 100755
--- a/src/mathicgb/SignatureGB.hpp
+++ b/src/mathicgb/SignatureGB.hpp
@@ -43,7 +43,7 @@ public:
unsigned long long getSingularReductionCount() const;
GroebnerBasis* getGB() { return GB.get(); }
- MonomialTableArray* getSyzTable() { return (mSchreyerTerms.empty() && !mReverseComponents) ? Hsyz.get() : Hsyz2.get(); }
+ MonomialTableArray* getSyzTable() { return (!mDoSchreyer && !mReverseComponents) ? Hsyz.get() : Hsyz2.get(); }
SigSPairs* getSigSPairs() { return SP.get(); }
size_t getMemoryUse() const;
@@ -105,6 +105,7 @@ private:
std::unique_ptr<SigSPairs> SP;
std::vector<monomial> mSchreyerTerms;
const bool mReverseComponents;
+ const bool mDoSchreyer;
const size_t mComponentCount;
};
diff --git a/src/test/FreeModuleOrderTest.cpp b/src/test/FreeModuleOrderTest.cpp
index a53bef1..40e941f 100755
--- a/src/test/FreeModuleOrderTest.cpp
+++ b/src/test/FreeModuleOrderTest.cpp
@@ -92,5 +92,5 @@ TEST(FreeModuleOrder, One) {
//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, "1 4 3 2 0 6 5 7", 6);
- runTest(ideal, sigs, "7 0 6 5 1 4 3 2", 7);
+ //runTest(ideal, sigs, "7 0 6 5 1 4 3 2", 7);
}
--
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