[mathicgb] 348/393: Further clean-up on the ModuleMonoSet and MonoLookup interfaces.

Doug Torrance dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:33 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 ff9664c61daff6c14dbee34c86f0f7958f4694b9
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date:   Thu Aug 29 19:50:45 2013 +0200

    Further clean-up on the ModuleMonoSet and MonoLookup interfaces.
---
 src/cli/GBCommonParams.cpp     | 14 +++++----
 src/mathicgb/ClassicGBAlg.cpp  |  8 +++--
 src/mathicgb/ModuleMonoSet.cpp | 69 +++++++++++++++++++++++++-----------------
 src/mathicgb/ModuleMonoSet.hpp | 64 ++++++++++++++++++++++++++++++---------
 src/mathicgb/MonoLookup.cpp    | 30 +++++++++---------
 src/mathicgb/MonoLookup.hpp    | 12 +++++---
 src/mathicgb/SigPolyBasis.cpp  |  8 ++---
 src/mathicgb/SignatureGB.cpp   | 14 ++++-----
 src/mathicgb/SignatureGB.hpp   |  2 ++
 src/mathicgb/StaticMonoMap.hpp | 20 ++++++------
 src/test/F4MatrixBuilder.cpp   |  7 +++--
 src/test/poly-test.cpp         |  4 +--
 12 files changed, 155 insertions(+), 97 deletions(-)

diff --git a/src/cli/GBCommonParams.cpp b/src/cli/GBCommonParams.cpp
index 9381134..07c4d86 100755
--- a/src/cli/GBCommonParams.cpp
+++ b/src/cli/GBCommonParams.cpp
@@ -64,14 +64,16 @@ GBCommonParams::GBCommonParams():
     mReducer.appendToDescription(reducerOut.str());
   }
   {
-    std::ostringstream monoLookupOut;
-    MonoLookup::displayMonoLookupTypes(monoLookupOut);
-    mMonoLookup.appendToDescription(monoLookupOut.str());
+    std::ostringstream out;
+    out << "Monomial map data structures codes:\n";
+    MonoLookup::displayCodes(out);
+    mMonoLookup.appendToDescription(out.str());
   }
   {
-    std::ostringstream monomialTableOut;
-    ModuleMonoSet::displayMTTypes(monomialTableOut);
-    mMonomialTable.appendToDescription(monomialTableOut.str());
+    std::ostringstream out;
+    out << "Module monomial set data structures codes:\n";
+    ModuleMonoSet::displayCodes(out);
+    mMonomialTable.appendToDescription(out.str());
   }
 }
 
diff --git a/src/mathicgb/ClassicGBAlg.cpp b/src/mathicgb/ClassicGBAlg.cpp
index 11014f1..633b328 100755
--- a/src/mathicgb/ClassicGBAlg.cpp
+++ b/src/mathicgb/ClassicGBAlg.cpp
@@ -30,9 +30,11 @@ ClassicGBAlg::ClassicGBAlg(
   mUseAutoTailReduction(false),
   mRing(*basis.getPolyRing()),
   mReducer(reducer),
-  mBasis(mRing, MonoLookup::makeFactory(
-    *basis.getPolyRing(),
-    monoLookupType)->create(preferSparseReducers, true)
+  mBasis(mRing,
+    MonoLookup::makeFactory(
+      basis.getPolyRing()->monoid(),
+      monoLookupType
+    )->make(preferSparseReducers, true)
   ),
   mSPairs(mBasis, preferSparseReducers),
   mSPolyReductionCount(0)
diff --git a/src/mathicgb/ModuleMonoSet.cpp b/src/mathicgb/ModuleMonoSet.cpp
index cb7f977..3224da3 100755
--- a/src/mathicgb/ModuleMonoSet.cpp
+++ b/src/mathicgb/ModuleMonoSet.cpp
@@ -36,7 +36,7 @@ public:
     delete[] reinterpret_cast<char*>(mLookups);
   }
 
-  virtual bool insert(const_monomial m) {
+  virtual bool insert(ConstMonoRef m) {
     const auto c = monoid().component(m);
     MATHICGB_ASSERT(c < componentCount());
     if (member(m))
@@ -47,7 +47,7 @@ public:
     return true;
   }
 
-  virtual bool member(const_monomial m) {
+  virtual bool member(ConstMonoRef m) {
     const auto c = monoid().component(m);
     MATHICGB_ASSERT(c < componentCount());
     return mLookups[c].divisor(m) != 0;
@@ -58,7 +58,7 @@ public:
   }
 
   virtual void display(std::ostream& out) const {
-    std::vector<const_monomial> monomials;
+    std::vector<ConstMonoPtr> monomials;
     for (size_t c = 0; c < componentCount(); ++c) {
       const Lookup& lookup = mLookups[c];
       if (lookup.size() == 0)
@@ -66,32 +66,43 @@ public:
       out << "  " << c << ": ";
       monomials.clear();
       lookup.forAll([&](const Entry& entry) {
-        monomials.emplace_back(Monoid::toOld(entry.mono()));
+        monomials.emplace_back(entry.mono().ptr());
       });
       const auto& monoid = this->monoid(); // workaround for gcc 4.5.3 issue
-      const auto cmp = [&](const_monomial a, const_monomial b) {
-        return monoid.lessThan(a, b);
+      const auto cmp = [&](ConstMonoPtr a, ConstMonoPtr b) {
+        return monoid.lessThan(*a, *b);
       };
       std::sort(monomials.begin(), monomials.end(), cmp);
       for (auto mono = monomials.cbegin(); mono != monomials.cend(); ++mono) {
-        MathicIO<>().writeMonomial(monoid, false, *mono, out);
+        MathicIO<>().writeMonomial(monoid, false, **mono, out);
         out << "  ";
       }
       out << '\n';
     }
   }
 
-  virtual void getMonomials(std::vector<const_monomial>& monomials) const {
+  virtual void getMonomials(std::vector<ConstMonoPtr>& monomials) const {
     for (size_t c = 0; c < componentCount(); ++c) {
       mLookups[c].forAll(
         [&](const Entry& entry) {
-          monomials.push_back(Monoid::toOld(entry.mono()));
+          monomials.push_back(entry.mono().ptr());
         }
       );
     }
   }
+
+  virtual void forAllVirtual(EntryOutput& consumer) {
+    for (size_t c = 0; c < componentCount(); ++c) {
+      mLookups[c].forAll(
+        [&](const Entry& entry) {
+          consumer.proceed(entry.mono());
+        }
+      );
+    }
+  }
+
   
-  virtual size_t n_elems() const {
+  virtual size_t elementCount() const {
     size_t count = 0;
     for (size_t c = 0; c < componentCount(); ++c)
       count += mLookups[c].size();
@@ -116,15 +127,14 @@ private:
   Lookup* const mLookups;
 };
 
-int ModuleMonoSet::displayMTTypes(std::ostream &o)
- // returns n s.t. 0..n-1 are valid types
-{
-  o << "Monomial table types:" << std::endl;
-  o << "  1   divlist+divmask" << std::endl;
-  o << "  2   kdtree+divmask" << std::endl;
-  o << "  3   divlist" << std::endl;
-  o << "  4   kdtree" << std::endl;
-  return 5;
+ModuleMonoSet::~ModuleMonoSet() {}
+
+void ModuleMonoSet::displayCodes(std::ostream& out) {
+  out <<
+   "  1   list, using divmasks\n"
+   "  2   KD-tree, using divmasks\n"
+   "  3   list\n"
+   "  4   KD-tree\n";
 }
 
 namespace {
@@ -132,15 +142,15 @@ namespace {
   public:
     typedef PolyRing::Monoid Monoid;
 
-    std::unique_ptr<ModuleMonoSet> create(
+    std::unique_ptr<ModuleMonoSet> make(
       const Monoid& monoid,
       int type,
       size_t componentCount,
       bool allowRemovals
     ) {
       const Params params = {monoid, type, componentCount};
-      return staticMonoLookupCreate
-        <Create, std::unique_ptr<ModuleMonoSet>>
+      return staticMonoLookupMake
+        <Make, std::unique_ptr<ModuleMonoSet>>
         (type, allowRemovals, params);
     }
 
@@ -152,8 +162,8 @@ namespace {
     };
 
     template<bool UseKDTree, bool AllowRemovals, bool UseDivMask>
-    struct Create {
-      static std::unique_ptr<ModuleMonoSet> create(const Params& params) {
+    struct Make {
+      static std::unique_ptr<ModuleMonoSet> make(const Params& params) {
         return make_unique
           <ConcreteModuleMonoSet<UseKDTree, AllowRemovals, UseDivMask>>
           (params.monoid, params.componentCount);
@@ -162,10 +172,13 @@ namespace {
   };
 }
 
-std::unique_ptr<ModuleMonoSet> ModuleMonoSet::make
-  (const PolyRing *R, int typ, size_t components, bool allowRemovals)
-{
-  return ModuleMonoSetFactory().create(R->monoid(), typ, components, allowRemovals);
+std::unique_ptr<ModuleMonoSet> ModuleMonoSet::make(
+  const Monoid& monoid,
+  const int type,
+  const size_t components,
+  const bool allowRemovals
+) {
+  return ModuleMonoSetFactory().make(monoid, type, components, allowRemovals);
 }
 
 MATHICGB_NAMESPACE_END
diff --git a/src/mathicgb/ModuleMonoSet.hpp b/src/mathicgb/ModuleMonoSet.hpp
index 734696b..44c51c0 100755
--- a/src/mathicgb/ModuleMonoSet.hpp
+++ b/src/mathicgb/ModuleMonoSet.hpp
@@ -10,34 +10,68 @@
 
 MATHICGB_NAMESPACE_BEGIN
 
+/// Represents the ideal generated by a set of module monomials.
 class ModuleMonoSet
 {
 public:
-  virtual ~ModuleMonoSet() {};
+  typedef PolyRing::Monoid Monoid;
+  typedef Monoid::ConstMonoRef ConstMonoRef;
+  typedef Monoid::ConstMonoPtr ConstMonoPtr;
 
-  // returns true if the monomial actually needs to be inserted.
-  // If the monomial is inserted, the caller agrees to keep that monomial
-  // active until it is removed from the table.
-  // Only inserts if minimal, in this case "true" is returned.
-  // and the object takes ownership of 'm'.
-  virtual bool insert(const_monomial m) = 0;
+  virtual ~ModuleMonoSet();
 
-  virtual bool member(const_monomial m) = 0;
+  /// Inserts mono into this set if it is not already a member of the
+  /// ideal generated by this set. Returns true if mono was inserted.
+  /// If this set was constructed to allow removals, any other module
+  /// monomials divisible by mono will be removed. A reference to
+  /// mono is retained but ownership is not passed.
+  virtual bool insert(ConstMonoRef mono) = 0;
 
-  virtual void display(std::ostream& o) const = 0;
+  /// Returns true if mono is a member of the ideal generated by this set.
+  virtual bool member(ConstMonoRef mono) = 0;
 
-  virtual void getMonomials(std::vector<const_monomial>& monomials) const = 0;
+  /// Prints a human-readable representation of this set to out.
+  virtual void display(std::ostream& out) const = 0;
 
-  virtual size_t n_elems() const = 0;
+  /// Returns the number of module monomials in this set. Take care not to
+  /// confuse this with the number of components.
+  virtual size_t elementCount() const = 0;
 
+  class EntryOutput {
+  public:
+    virtual void proceed(ConstMonoRef mono) = 0;
+  };
+
+  /// Calls consumer.proceed(mono) for each mono in this set.
+  virtual void forAllVirtual(EntryOutput& consumer) = 0;
+
+  /// Calls func(mono) for eac mono in this set.
+  template<class Func>
+  void forAll(Func&& func) {
+    struct Wrap : EntryOutput {
+      Wrap(Func&& func): mFunc(std::forward<Func>(func)) {}
+      virtual void proceed(ConstMonoRef mono) {mFunc(mono);}
+      Func&& mFunc;
+    } wrap(std::forward<Func>(func));
+    forAllVirtual(wrap);
+  }
+
+  /// Returns a descriptive name for the implementation of this set.
   virtual std::string name() const = 0;
 
   virtual size_t getMemoryUse() const = 0;
 
-  // Choosing one
-  static int displayMTTypes(std::ostream &o); // returns n s.t. 0..n-1 are valid types
-  static std::unique_ptr<ModuleMonoSet>
-    make(const PolyRing *R, int typ, size_t components, bool allowRemovals);
+  /// Prints a human-readable description of the type codes for the
+  /// implementations of this interface.
+  static void displayCodes(std::ostream& out);
+
+  /// This is how you should instantiate classes that implement this interface.
+  static std::unique_ptr<ModuleMonoSet> make(
+    const Monoid& monoid,
+    int type, // the type code - which implementation do you want?
+    size_t componentCount,
+    bool allowRemovals
+  );
 };
 
 MATHICGB_NAMESPACE_END
diff --git a/src/mathicgb/MonoLookup.cpp b/src/mathicgb/MonoLookup.cpp
index cd4d25e..47c17df 100755
--- a/src/mathicgb/MonoLookup.cpp
+++ b/src/mathicgb/MonoLookup.cpp
@@ -135,13 +135,13 @@ namespace {
       mType(type)
     {}
 
-    virtual std::unique_ptr<MonoLookup> create(
+    virtual std::unique_ptr<MonoLookup> make(
       bool preferSparseReducers,
       bool allowRemovals
     ) const {
       Params params = {mMonoid, mType, preferSparseReducers};
-      return staticMonoLookupCreate
-        <Create, std::unique_ptr<MonoLookup>>(mType, allowRemovals, params);
+      return staticMonoLookupMake
+        <Make, std::unique_ptr<MonoLookup>>(mType, allowRemovals, params);
     }
 
   private:
@@ -152,8 +152,8 @@ namespace {
     };
 
     template<bool UseKDTree, bool AllowRemovals, bool UseDivMask>
-    struct Create {
-      static std::unique_ptr<MonoLookup> create(const Params& params) {
+    struct Make {
+      static std::unique_ptr<MonoLookup> make(const Params& params) {
         auto p = new ConcreteMonoLookup<UseKDTree, AllowRemovals, UseDivMask>
           (params.monoid, params.type, params.preferSparseReducers);
         return std::unique_ptr<MonoLookup>(p);
@@ -165,19 +165,21 @@ namespace {
   };
 }
 
+MonoLookup::~MonoLookup() {}
+
 std::unique_ptr<MonoLookup::Factory> MonoLookup::makeFactory(
-  const PolyRing& ring,
-  int type
+  const Monoid& monoid,
+  const int type
 ) {
-  return std::unique_ptr<Factory>(new ConcreteFactory(ring.monoid(), type));
+  return std::unique_ptr<Factory>(new ConcreteFactory(monoid, type));
 }
 
-void MonoLookup::displayMonoLookupTypes(std::ostream& out) {
-  out << "Mono Lookup Types:" << std::endl;
-  out << "  1   divlist+divmask" << std::endl;
-  out << "  2   kdtree+divmask" << std::endl;
-  out << "  3   divlist" << std::endl;
-  out << "  4   kdtree" << std::endl;
+void MonoLookup::displayCodes(std::ostream& out) {
+  out <<
+   "  1   list, using divmasks\n"
+   "  2   KD-tree, using divmasks\n"
+   "  3   list\n"
+   "  4   KD-tree\n";
 }
 
 MATHICGB_NAMESPACE_END
diff --git a/src/mathicgb/MonoLookup.hpp b/src/mathicgb/MonoLookup.hpp
index 09f0866..cdf0edd 100755
--- a/src/mathicgb/MonoLookup.hpp
+++ b/src/mathicgb/MonoLookup.hpp
@@ -20,6 +20,8 @@ public:
   typedef Monoid::ConstMonoRef ConstMonoRef;
   typedef Monoid::ConstMonoPtr ConstMonoPtr;
 
+  virtual ~MonoLookup();
+
   // Call after construction. Can be called multiple times, but only if the
   // parameter object is the same each time.
   virtual void setBasis(const PolyBasis& basis) = 0;
@@ -28,8 +30,6 @@ public:
   // parameter object is the same each time.
   virtual void setSigBasis(const SigPolyBasis& sigBasis) = 0;
 
-  virtual ~MonoLookup() {}
-
   virtual void insert(ConstMonoRef mono, size_t index) = 0;
 
   // Returns the index of a basis element that regular reduces mono in
@@ -57,15 +57,17 @@ public:
 
   virtual int type() const = 0;
 
-  static void displayMonoLookupTypes(std::ostream& out);
+  /// Prints a human-readable description of the type codes for the
+  /// implementations of this interface.
+  static void displayCodes(std::ostream& out);
 
   class Factory {
   public:
-    virtual std::unique_ptr<MonoLookup> create
+    virtual std::unique_ptr<MonoLookup> make
       (bool preferSparseReducers, bool allowRemovals) const = 0;
   };
   static std::unique_ptr<Factory> makeFactory
-    (const PolyRing& ring, int type);
+    (const Monoid& monoid, int type);
 
   class EntryOutput {
   public:
diff --git a/src/mathicgb/SigPolyBasis.cpp b/src/mathicgb/SigPolyBasis.cpp
index 09486d5..5d7dccc 100755
--- a/src/mathicgb/SigPolyBasis.cpp
+++ b/src/mathicgb/SigPolyBasis.cpp
@@ -16,10 +16,10 @@ SigPolyBasis::SigPolyBasis(
   int monTableType,
   bool preferSparseReducers):
   mMonoLookupFactory
-    (MonoLookup::makeFactory(*R0, monoLookupType)),
+    (MonoLookup::makeFactory(R0->monoid(), monoLookupType)),
   mRatioSorted(RatioOrder(sigLeadRatio, R0->monoid())),
-  mMinimalMonoLookup(mMonoLookupFactory->create(preferSparseReducers, true)),
-  mBasis(*R0, mMonoLookupFactory->create(preferSparseReducers, true)),
+  mMinimalMonoLookup(mMonoLookupFactory->make(preferSparseReducers, true)),
+  mBasis(*R0, mMonoLookupFactory->make(preferSparseReducers, true)),
   mPreferSparseReducers(preferSparseReducers)
 {
   mTmp = mBasis.ring().allocMonomial();
@@ -45,7 +45,7 @@ SigPolyBasis::~SigPolyBasis()
 
 void SigPolyBasis::addComponent() {
   std::unique_ptr<MonoLookup> lookup =
-    mMonoLookupFactory->create(mPreferSparseReducers, true);
+    mMonoLookupFactory->make(mPreferSparseReducers, true);
   lookup->setSigBasis(*this);
   mSignatureLookup.push_back(0);
   mSignatureLookup.back() = lookup.release(); // only release after alloc
diff --git a/src/mathicgb/SignatureGB.cpp b/src/mathicgb/SignatureGB.cpp
index 66ed14d..b9b62dd 100755
--- a/src/mathicgb/SignatureGB.cpp
+++ b/src/mathicgb/SignatureGB.cpp
@@ -41,8 +41,8 @@ SignatureGB::SignatureGB(
   stats_nsecs(0.0),
   GB(make_unique<SigPolyBasis>(R, divlookup_type, montable_type, preferSparseReducers)),
   mKoszuls(R->monoid()),
-  Hsyz(ModuleMonoSet::make(R, montable_type, basis.size(), !mPostponeKoszul)),
-  Hsyz2(ModuleMonoSet::make(R, montable_type, basis.size(), !mPostponeKoszul)),
+  Hsyz(ModuleMonoSet::make(R->monoid(), montable_type, basis.size(), !mPostponeKoszul)),
+  Hsyz2(ModuleMonoSet::make(R->monoid(), montable_type, basis.size(), !mPostponeKoszul)),
   reducer(Reducer::makeReducer(reductiontyp, *R)),
   SP(make_unique<SigSPairs>(R, GB.get(), Hsyz.get(), reducer.get(), mPostponeKoszul, mUseBaseDivisors, useSingularCriterionEarly, queueType))
 {
@@ -126,14 +126,12 @@ void SignatureGB::computeGrobnerBasis()
 
   if (mProcessor->processingNeeded()) {
     GB->postprocess(*mProcessor);
-    std::vector<const_monomial> v;
-    Hsyz->getMonomials(v);
-    for (size_t i = 0; i < v.size(); ++i) {
+    Hsyz->forAll([&](ConstMonoRef mono) {
       auto sig = R->allocMonomial();
-      R->monomialCopy(v[i], sig);
+      R->monoid().copy(mono, sig);
       mProcessor->postprocess(sig);
       Hsyz2->insert(sig);
-    }
+    });
   }
 }
 
@@ -494,7 +492,7 @@ void SignatureGB::displaySomeStats(std::ostream& out) const {
   extra << mic::ColumnPrinter::percentInteger(timeSinceLastMinLead, basisSize)
     << " of basis added since then\n";
 
-  const size_t minSyz = Hsyz->n_elems();
+  const size_t minSyz = Hsyz->elementCount();
   const double syzBasisRatio =
     static_cast<double>(minSyz) / basisSize;
   name << "Minimal syzygies:\n";
diff --git a/src/mathicgb/SignatureGB.hpp b/src/mathicgb/SignatureGB.hpp
index 4429684..de76f0a 100755
--- a/src/mathicgb/SignatureGB.hpp
+++ b/src/mathicgb/SignatureGB.hpp
@@ -20,6 +20,8 @@ class SigSPairs;
 class SignatureGB {
 public:
   typedef PolyRing::Monoid Monoid;
+  typedef Monoid::ConstMonoRef ConstMonoRef;
+  typedef Monoid::ConstMonoPtr ConstMonoPtr;
   typedef Monoid::MonoVector MonoVector;
   typedef MonoProcessor<Monoid> Processor;
   typedef Monoid::Component Component;
diff --git a/src/mathicgb/StaticMonoMap.hpp b/src/mathicgb/StaticMonoMap.hpp
index 59ba6c2..4c7a0dc 100755
--- a/src/mathicgb/StaticMonoMap.hpp
+++ b/src/mathicgb/StaticMonoMap.hpp
@@ -388,7 +388,7 @@ private:
 ///
 /// template<bool UseKDTree, bool AllowRemovals, bool UseDivMask>
 /// struct Functor {
-///   static ReturnType create(const Params& params) {
+///   static ReturnType make(const Params& params) {
 ///     // do your thing
 ///   }
 /// };
@@ -397,7 +397,7 @@ template<
   class ReturnType,
   class Params
 >
-ReturnType staticMonoLookupCreate(
+ReturnType staticMonoLookupMake(
   int type,
   bool allowRemovals,
   Params&& params
@@ -405,27 +405,27 @@ ReturnType staticMonoLookupCreate(
   switch (type) {
   case 1:
     if (allowRemovals)
-      return Functor<0, 1, 1>::create(std::forward<Params>(params));
+      return Functor<0, 1, 1>::make(std::forward<Params>(params));
     else
-      return Functor<0, 0, 1>::create(std::forward<Params>(params));
+      return Functor<0, 0, 1>::make(std::forward<Params>(params));
     
   case 2:
     if (allowRemovals)
-      return Functor<1, 1, 1>::create(std::forward<Params>(params));
+      return Functor<1, 1, 1>::make(std::forward<Params>(params));
     else
-      return Functor<1, 0, 1>::create(std::forward<Params>(params));
+      return Functor<1, 0, 1>::make(std::forward<Params>(params));
 
   case 3:
     if (allowRemovals)
-      return Functor<0, 1, 0>::create(std::forward<Params>(params));
+      return Functor<0, 1, 0>::make(std::forward<Params>(params));
     else
-      return Functor<0, 0, 0>::create(std::forward<Params>(params));
+      return Functor<0, 0, 0>::make(std::forward<Params>(params));
 
   case 4:
     if (allowRemovals)
-      return Functor<1, 1, 0>::create(std::forward<Params>(params));
+      return Functor<1, 1, 0>::make(std::forward<Params>(params));
     else
-      return Functor<1, 0, 0>::create(std::forward<Params>(params));
+      return Functor<1, 0, 0>::make(std::forward<Params>(params));
 
   default:
     MATHICGB_ASSERT_NO_ASSUME(false);
diff --git a/src/test/F4MatrixBuilder.cpp b/src/test/F4MatrixBuilder.cpp
index a5671c9..5e292af 100755
--- a/src/test/F4MatrixBuilder.cpp
+++ b/src/test/F4MatrixBuilder.cpp
@@ -25,8 +25,11 @@ namespace {
     BuilderMaker():
       mRing(ringFromString("101 6 1\n1 1 1 1 1 1")),
       mIdeal(*mRing),
-      mBasis(*mRing, MonoLookup::makeFactory(*mRing, 1)->create(true, true)) {
-    }
+      mBasis(
+        *mRing,
+        MonoLookup::makeFactory(mRing->monoid(), 1)->make(true, true)
+      )
+    {}
 
     const Poly& addBasisElement(const std::string& str) {
       std::unique_ptr<Poly> p(new Poly(*mRing));
diff --git a/src/test/poly-test.cpp b/src/test/poly-test.cpp
index 4f695b8..fb359bc 100755
--- a/src/test/poly-test.cpp
+++ b/src/test/poly-test.cpp
@@ -504,7 +504,7 @@ TEST(Coeff, addone) {
 TEST(MTArray,DivList1) {
   // We create a table here
   std::unique_ptr<PolyRing> R(ringFromString("32003 6 1\n1 1 1 1 1 1"));
-  auto M = ModuleMonoSet::make(R.get(), 1, 6, false);
+  auto M = ModuleMonoSet::make(R->monoid(), 1, 6, false);
   std::string mons[2] = {
     "abc<1>",
     "a2d<1>"
@@ -528,7 +528,7 @@ TEST(MTArray,DivList1) {
 TEST(MTArray,KDTree1) {
   // We create a table here
   std::unique_ptr<PolyRing> R(ringFromString("32003 6 1\n1 1 1 1 1 1"));
-  std::unique_ptr<ModuleMonoSet> M(ModuleMonoSet::make(R.get(), 2, 6, false));
+  std::unique_ptr<ModuleMonoSet> M(ModuleMonoSet::make(R->monoid(), 2, 6, false));
   std::string mons[2] = {
     "abc<1>",
     "a2d<1>"

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