[mathicgb] 250/393: The library interface now allows setting the maximum S-pair group size.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:13 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 7d836215921f340a258307a5ad7f21169cacfdc1
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Sun Apr 14 15:40:57 2013 -0400

    The library interface now allows setting the maximum S-pair group size.
---
 src/mathicgb.cpp | 11 +++++++++++
 src/mathicgb.h   | 13 ++++++++++++-
 2 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/mathicgb.cpp b/src/mathicgb.cpp
index c09c011..746fdf1 100755
--- a/src/mathicgb.cpp
+++ b/src/mathicgb.cpp
@@ -314,6 +314,7 @@ namespace mgb {
       mModulus(modulus),
       mVarCount(varCount),
       mReducer(DefaultReducer),
+      mMaxSPairGroupSize(0),
       mMaxThreadCount(0),
       mLogging()
 #ifdef MATHICGB_DEBUG
@@ -347,6 +348,7 @@ namespace mgb {
     const Coefficient mModulus;
     const VarIndex mVarCount;
     Reducer mReducer;
+    size_t mMaxSPairGroupSize;
     size_t mMaxThreadCount;
     std::string mLogging;
     MATHICGB_IF_DEBUG(bool mHasBeenDestroyed);
@@ -405,6 +407,14 @@ namespace mgb {
     return mPimpl->mReducer;
   }
 
+  void GroebnerConfiguration::setMaxSPairGroupSize(size_t size) {
+    mPimpl->mMaxSPairGroupSize = size;
+  }
+
+  size_t GroebnerConfiguration::maxSPairGroupSize() const {
+    return mPimpl->mMaxSPairGroupSize;
+  }
+
   void GroebnerConfiguration::setMaxThreadCount(size_t maxThreadCount) {
     mPimpl->mMaxThreadCount = maxThreadCount;
   }
@@ -685,6 +695,7 @@ namespace mgbi {
     alg.setReducerMemoryQuantum(100 * 1024);
     alg.setUseAutoTopReduction(true);
     alg.setUseAutoTailReduction(false);
+    alg.setSPairGroupSize(conf.maxSPairGroupSize());
 
     // Compute Groebner basis
     alg.computeGrobnerBasis();
diff --git a/src/mathicgb.h b/src/mathicgb.h
index 1ebbeb8..1e9425f 100755
--- a/src/mathicgb.h
+++ b/src/mathicgb.h
@@ -44,9 +44,20 @@ namespace mgb { // Part of the public interface of MathicGB
     void setReducer(Reducer reducer);
     Reducer reducer() const;
 
+    /// Sets the maximum number of S-pairs to reduce at one time. This is
+    /// mainly useful as a (weak) control on memory usage for F4 reducers.
+    /// A value of 0 indicates to let the library decide this value for
+    /// itself, which is also the default and highly recommended value.
+    ///
+    /// For matrix-based reducers, use a high value. For serial classic
+    /// reduction, use a low value, preferably 1. Setting the value to
+    /// 0 already takes care of this.
+    void setMaxSPairGroupSize(size_t size);
+    size_t maxSPairGroupSize() const;
+
     /// Sets the maximum number of threads to use. May use fewer threads.
     /// A value of 0 indicates to let the library decide this value for
-    /// it self, which is also the default value.
+    /// itself, which is also the default value.
     void setMaxThreadCount(size_t maxThreadCount);
     size_t maxThreadCount() const;
 

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