Macaulay2 Engine
Loading...
Searching...
No Matches
hermite.hpp
Go to the documentation of this file.
1// Copyright 1996 Michael E. Stillman
2#ifndef _hermite_hh_
3#define _hermite_hh_
4
34
35#include "relem.hpp"
36#include "matrix.hpp"
37#include "polyring.hpp"
38#include "comp-gb.hpp"
39#include "ZZ.hpp"
40#include <vector>
41
42struct hm_elem : public our_new_delete
43{
45 mpz_t lead;
46 vec f;
47 vec fsyz;
48};
49
56{
57 private:
58 int row;
59 VECTOR(hm_elem *) initial;
60
61 const Matrix *gens; // This is the input
62
65 VECTOR(vec) syz_list;
66
67 int n_gb;
68 int collect_syz; // 0 or 1
70
71 private:
72 hm_elem *new_gen(int i);
73 void remove_hm_elem(hm_elem *&p);
74 void insert(hm_elem *p);
75
76 int compare_elems(hm_elem *f, hm_elem *g) const;
78 void sort(hm_elem *&p);
79 void reduce(hm_elem *&p, hm_elem *q);
80
81 void gb_reduce(vec &f) const;
82 void gb_reduce(vec &f, vec &fsyz) const;
83
84 virtual bool stop_conditions_ok() { return true; }
85 public:
86 // An honest GB computation
87 HermiteComputation(const Matrix *m, int collect_syz, int n_syz);
89
90 virtual void remove_gb() {}
91 virtual void start_computation();
92
93 virtual int complete_thru_degree() const;
94 // The computation is complete up through this degree.
95
96 virtual Ring *get_ring() const { return globalZZ; }
98 // Results of the computation //
100 virtual const Matrix /* or null */ *get_gb();
101
102 virtual const Matrix /* or null */ *get_mingens();
103
104 virtual const Matrix /* or null */ *get_change();
105
106 virtual const Matrix /* or null */ *get_syzygies();
107
108 virtual const Matrix /* or null */ *get_initial(int nparts);
109
111 // Normal forms and lifting ////
113
114 virtual const Matrix /* or null */ *matrix_remainder(const Matrix *m);
115
116 virtual M2_bool matrix_lift(const Matrix *m,
117 const Matrix /* or null */ **result_remainder,
118 const Matrix /* or null */ **result_quotient);
119
120 virtual int contains(const Matrix *m);
121
123 // Statistics and spair information //
125
126 virtual void text_out(buffer &o) const;
127 // This displays statistical information, and depends on the
128 // M2_gbTrace value.
129};
130#endif
131
132// Local Variables:
133// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
134// indent-tabs-mode: nil
135// End:
Legacy RingZZ — a Ring-derived integer ring backed by GMP mpz_t.
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
HermiteComputation(const Matrix *m, int collect_syz, int n_syz)
Definition hermite.cpp:59
virtual const Matrix * matrix_remainder(const Matrix *m)
Definition hermite.cpp:461
hm_elem * new_gen(int i)
Definition hermite.cpp:21
virtual int complete_thru_degree() const
Definition hermite.cpp:14
void remove_hm_elem(hm_elem *&p)
Definition hermite.cpp:81
virtual void text_out(buffer &o) const
Definition hermite.cpp:359
virtual const Matrix * get_initial(int nparts)
Definition hermite.cpp:347
virtual void start_computation()
Definition hermite.cpp:260
virtual int contains(const Matrix *m)
Definition hermite.cpp:524
const FreeModule * Fsyz
Definition hermite.hpp:64
virtual bool stop_conditions_ok()
Definition hermite.hpp:84
void reduce(hm_elem *&p, hm_elem *q)
Definition hermite.cpp:210
virtual Ring * get_ring() const
Definition hermite.hpp:96
void insert(hm_elem *p)
Definition hermite.cpp:42
virtual const Matrix * get_syzygies()
Definition hermite.cpp:339
const Matrix * gens
Definition hermite.hpp:61
void gb_reduce(vec &f) const
Definition hermite.cpp:387
int compare_elems(hm_elem *f, hm_elem *g) const
Definition hermite.cpp:116
hm_elem * merge(hm_elem *f, hm_elem *g)
Definition hermite.cpp:124
virtual const Matrix * get_gb()
Definition hermite.cpp:317
VECTOR(hm_elem *) initial
hm_elem * GB_list
Definition hermite.hpp:63
virtual void remove_gb()
Definition hermite.hpp:90
virtual const Matrix * get_change()
Definition hermite.cpp:331
virtual M2_bool matrix_lift(const Matrix *m, const Matrix **result_remainder, const Matrix **result_quotient)
Definition hermite.cpp:485
virtual const Matrix * get_mingens()
Definition hermite.cpp:325
void sort(hm_elem *&p)
Definition hermite.cpp:185
VECTOR(vec) syz_list
xxx xxx xxx
Definition ring.hpp:102
GBComputation — abstract base of every Groebner-basis algorithm in the engine.
#define Matrix
Definition factory.cpp:14
RingZZ * globalZZ
Definition relem.cpp:13
int p
char M2_bool
Definition m2-types.h:82
Matrix — the engine's immutable homomorphism F -> G between free modules.
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
RingElement — tagged (Ring*, ring_elem) pair, the engine's universal element type.
vec f
Definition hermite.hpp:46
mpz_t lead
Definition hermite.hpp:45
hm_elem * next
Definition hermite.hpp:44
vec fsyz
Definition hermite.hpp:47