Macaulay2 Engine
Loading...
Searching...
No Matches
reducedgb.hpp
Go to the documentation of this file.
1// Copyright 2004 Michael E. Stillman.
2
3#ifndef _reducedgb_hpp_
4#define _reducedgb_hpp_
5
44
45#include "comp-gb.hpp"
46#include <vector>
47#include "gbring.hpp"
48#include "montable.hpp"
49#include "montableZZ.hpp"
50#include "gbweight.hpp"
51#include "polyring.hpp"
52
62{
63 protected:
66 const FreeModule *F;
68 VECTOR(POLY) polys;
69
70 virtual bool stop_conditions_ok() { return true; }
71 // If the stop conditions in _Stop are inappropriate,
72 // return false, and use ERROR(...) to provide an error message.
73
74 ReducedGB(GBRing *R0,
75 const PolynomialRing *originalR0,
76 const FreeModule *F0,
77 const FreeModule *Fsyz0);
78
79 public:
80 virtual ~ReducedGB();
81
82 static ReducedGB *create(const PolynomialRing *originalR0,
83 const FreeModule *F0,
84 const FreeModule *Fsyz0,
85 const GBWeight *wt0 = nullptr);
86
87 virtual GBComputation *cast_to_GBComputation() { return this; }
88 virtual void start_computation() {}
89 virtual int complete_thru_degree() const { return 0; }
90 // The computation is complete up through this degree.
91
92 // Recall that the status of the computation is maintained by the Computation
93 // class,
94
95 virtual const Ring *get_ring() const { return originalR; }
97 // Results of the computation //
99 virtual const Matrix /* or null */ *get_gb();
100
101 virtual const Matrix /* or null */ *get_mingens();
102
103 virtual const Matrix /* or null */ *get_change();
104
105 virtual const Matrix /* or null */ *get_syzygies();
106
107 virtual const Matrix /* or null */ *get_initial(int nparts);
108
109 virtual const Matrix /* or null */ *get_parallel_lead_terms(M2_arrayint w);
110
112 // Statistics and spair information //
114
115 virtual void text_out(buffer &o) const;
116 // This displays statistical information, and depends on the
117 // M2_gbTrace value.
118
120 // Normal forms and lifting ////
122
123 virtual const Matrix /* or null */ *matrix_remainder(const Matrix *m);
124
125 virtual M2_bool matrix_lift(const Matrix *m,
126 const Matrix /* or null */ **result_remainder,
127 const Matrix /* or null */ **result_quotient);
128
129 virtual int contains(const Matrix *m);
130
132 // The following are the functions which need //
133 // to be provided by subclasses //
135
136 virtual void set_gb(VECTOR(POLY) & polys0) = 0;
137
138 virtual void minimalize(const VECTOR(POLY) & polys0, bool auto_reduce = true)
139 {
140 (void) polys0;
141 (void) auto_reduce;
142 }
143
144 // I have to decide: does this ADD to the existing set?
145
146 // Choose a minimal set of generators of the lead terms.
147 // sort the resulting elements
148 // auto reduce them
149 // This class will be subclassed by:
150 // base is a field
151 // base is ZZ, strong GB
152 // base is ZZ, weak GB
153 // base is a frac field, # frac vars is given.
154 // ring has a local term order: reduction can not be complete...
155
156 // const VECTOR(POLY) &get() const { return polys; }
157
158 virtual void remainder(POLY &f, bool use_denom, ring_elem &denom) = 0;
159 // WARNING: this should only be used with term orders!
160 // REALLY??
161
162 virtual void remainder(gbvector *&f, bool use_denom, ring_elem &denom) = 0;
163};
164
165#endif
166
167// Local Variables:
168// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
169// indent-tabs-mode: nil
170// End:
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
Polynomial-ring view tuned for the inner loop of classical Buchberger Groebner-basis computations.
Definition gbring.hpp:120
Heuristic-weight evaluator for gbvectors, used during Groebner basis computation to drive the S-pair ...
Definition gbweight.hpp:67
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
virtual const Matrix * matrix_remainder(const Matrix *m)
virtual void minimalize(const VECTOR(POLY) &polys0, bool auto_reduce=true)
VECTOR(POLY) polys
virtual const Matrix * get_change()
Definition reducedgb.cpp:80
virtual const Matrix * get_mingens()
Definition reducedgb.cpp:64
virtual const Matrix * get_syzygies()
Definition reducedgb.cpp:72
virtual void text_out(buffer &o) const
virtual const Matrix * get_initial(int nparts)
Definition reducedgb.cpp:91
virtual const Matrix * get_parallel_lead_terms(M2_arrayint w)
const FreeModule * Fsyz
Definition reducedgb.hpp:67
virtual bool stop_conditions_ok()
Definition reducedgb.hpp:70
virtual void remainder(POLY &f, bool use_denom, ring_elem &denom)=0
virtual int contains(const Matrix *m)
static ReducedGB * create(const PolynomialRing *originalR0, const FreeModule *F0, const FreeModule *Fsyz0, const GBWeight *wt0=nullptr)
Definition reducedgb.cpp:11
virtual const Matrix * get_gb()
Definition reducedgb.cpp:53
virtual void set_gb(VECTOR(POLY) &polys0)=0
GBRing * R
Definition reducedgb.hpp:64
virtual const Ring * get_ring() const
Definition reducedgb.hpp:95
const PolynomialRing * originalR
Definition reducedgb.hpp:65
virtual void start_computation()
Definition reducedgb.hpp:88
virtual M2_bool matrix_lift(const Matrix *m, const Matrix **result_remainder, const Matrix **result_quotient)
const FreeModule * F
Definition reducedgb.hpp:66
virtual GBComputation * cast_to_GBComputation()
Definition reducedgb.hpp:87
virtual ~ReducedGB()
Definition reducedgb.cpp:44
virtual int complete_thru_degree() const
Definition reducedgb.hpp:89
ReducedGB(GBRing *R0, const PolynomialRing *originalR0, const FreeModule *F0, const FreeModule *Fsyz0)
Definition reducedgb.cpp:35
virtual void remainder(gbvector *&f, bool use_denom, ring_elem &denom)=0
Base class for reduced Groebner basis computation.
Definition reducedgb.hpp:62
xxx xxx xxx
Definition ring.hpp:102
GBComputation — abstract base of every Groebner-basis algorithm in the engine.
#define Matrix
Definition factory.cpp:14
GBRing and gbvector — the GB-tuned polynomial-ring view used by classical Buchberger code.
GBWeight — packed-weight evaluator that drives S-pair selection.
char M2_bool
Definition m2-types.h:82
MonomialTable — leading-monomial divisor index used by the GB reducer.
MonomialTableZZ — coefficient-aware leading-monomial index for ZZ-coefficient Groebner bases.
#define VECTOR(T)
Definition newdelete.hpp:78
#define POLY(q)
Definition poly.cpp:23
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.