Macaulay2 Engine
Loading...
Searching...
No Matches
Eschreyer.hpp
Go to the documentation of this file.
1// Copyright 1999 Michael E. Stillman
2#ifndef _Eschreyer_hpp_
3#define _Eschreyer_hpp_
4
32
33#include "polyring.hpp"
34#include "gbring.hpp"
35#include "schorder.hpp"
36#include "matrix.hpp"
37#include "monoid.hpp"
38#include "comp.hpp"
39
53struct GBMatrix : public our_new_delete
54{
55 const FreeModule *F; // target
57
58 GBMatrix(const Matrix *m);
59 GBMatrix(const FreeModule *F);
60 void append(gbvector *f); // grabs f
61 const FreeModule *get_free_module() const { return F; }
63};
64
82{
83 // these three were virtual in class Computation
84 bool stop_conditions_ok() { return true; }
85 int complete_thru_degree() const { return 0; }
88 const Ring *K;
90 const Monoid *M;
91 const SchreyerOrder *SF; // order for F.
92 const SchreyerOrder *SG; // order for G.
93 const FreeModule *F; // This is where the action is...
94 const FreeModule *G; // This is where the resulting syzygies live.
95 // This MUST be a Schreyer free module compatible with the input!
96
97 gc_vector<MonomialIdeal*> mi; // Used in reduction.
98 gc_vector<gbvector*> gb; // This is the "stripped" GB.
99 gc_vector<gbvector*> syzygies; // This is basically the result.
100
101 // byte sizes for allocating temp exp vectors and monomials on the stack
102 size_t exp_size;
104
109
110 void new_pairs(int i);
112 void strip_gb(const GBMatrix *m);
113
114 gbvector *make_syz_term(ring_elem c, const_monomial monom, int comp) const;
115 // This routine grabs 'c', and 'monom' should be the total monomial.
116
118 int find_divisor(const MonomialIdeal *mi, const_exponents exp, int &result);
119 // Returns the index of the least element in the monomial order which divides.
120
122 // removes every term of f which is not a lead term of some element of gb.
123
124 gbvector *s_pair(gbvector *syz);
125 void reduce(gbvector *&g,
126 gbvector *&gsyz); // Reduces g to zero. gsyz is real result.
127 void geo_reduce(gbvector *&g,
128 gbvector *&gsyz); // Reduces g to zero. gsyz is real result.
129 public:
131
132 virtual ~GBKernelComputation();
133
134 int calc();
135
137
138 public:
141 {
142 return this;
143 }
144};
145
146#endif
147
148// Local Variables:
149// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
150// indent-tabs-mode: nil
151// End:
exponents::ConstExponents const_exponents
Computation()
Definition comp.cpp:40
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
int find_divisor(const MonomialIdeal *mi, const_exponents exp, int &result)
bool find_ring_divisor(const_exponents exp, const gbvector *&result)
void reduce(gbvector *&g, gbvector *&gsyz)
const FreeModule * F
Definition Eschreyer.hpp:93
void geo_reduce(gbvector *&g, gbvector *&gsyz)
gc_vector< gbvector * > syzygies
Definition Eschreyer.hpp:99
virtual ~GBKernelComputation()
Definition Eschreyer.cpp:93
const FreeModule * G
Definition Eschreyer.hpp:94
void new_pairs(int i)
void strip_gb(const gc_vector< gbvector * > &m)
const SchreyerOrder * SF
Definition Eschreyer.hpp:91
const GBKernelComputation * cast_to_GBKernelComputation() const
const PolynomialRing * R
Definition Eschreyer.hpp:87
int complete_thru_degree() const
Definition Eschreyer.hpp:85
GBMatrix * get_syzygies()
gc_vector< gbvector * > gb
Definition Eschreyer.hpp:98
GBKernelComputation(const GBMatrix *m)
Definition Eschreyer.cpp:69
void wipe_unneeded_terms(gbvector *&f)
const SchreyerOrder * SG
Definition Eschreyer.hpp:92
gbvector * s_pair(gbvector *syz)
gc_vector< MonomialIdeal * > mi
Definition Eschreyer.hpp:97
gbvector * make_syz_term(ring_elem c, const_monomial monom, int comp) const
const Monoid * M
Definition Eschreyer.hpp:90
GBKernelComputation * cast_to_GBKernelComputation()
Polynomial-ring view tuned for the inner loop of classical Buchberger Groebner-basis computations.
Definition gbring.hpp:120
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
Definition monoid.hpp:89
Engine-side monomial ideal: a decision tree of Nmi_nodes storing the (typically minimal) generators b...
Definition monideal.hpp:136
Abstract base for the engine's polynomial-ring hierarchy.
Definition polyring.hpp:96
xxx xxx xxx
Definition ring.hpp:102
Per-component tie-breaker data for a Schreyer monomial order on a FreeModule.
Definition schorder.hpp:68
Abstract Computation base class — stop-condition machinery for incremental engine work.
#define Matrix
Definition factory.cpp:14
GBRing and gbvector — the GB-tuned polynomial-ring view used by classical Buchberger code.
const int * const_monomial
Definition imonorder.hpp:45
VALGRIND_MAKE_MEM_DEFINED & result(result)
Matrix — the engine's immutable homomorphism F -> G between free modules.
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
typename std::vector< T, gc_allocator< T > > gc_vector
a version of the STL vector, which allocates its backing memory with gc.
Definition newdelete.hpp:76
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
SchreyerOrder — per-basis-element data backing the Schreyer order on a free module.
Matrix * to_matrix()
Definition Eschreyer.cpp:55
void append(gbvector *f)
Definition Eschreyer.cpp:53
const FreeModule * get_free_module() const
Definition Eschreyer.hpp:61
gc_vector< gbvector * > elems
Definition Eschreyer.hpp:56
const FreeModule * F
Definition Eschreyer.hpp:55
GBMatrix(const Matrix *m)
Definition Eschreyer.cpp:41
gbvector-side matrix: a target FreeModule plus a list of gbvector* columns living in it.
Definition Eschreyer.hpp:54