Macaulay2 Engine
Loading...
Searching...
No Matches
res-a1-poly.hpp
Go to the documentation of this file.
1// Copyright 1996. Michael E. Stillman
2
3#ifndef _respoly_hh_
4#define _respoly_hh_
5
6#include "monideal.hpp"
7
8struct resterm;
9
10// The following are the possible types of res_pairs's
11enum {
12 SYZ_RING_ELEM, // Base ring elements: will go away...
13 SYZ_EXTERIOR_VAR, // possibly will go away...
14 SYZ_BASE_COMPONENT, // Base component at level 0
15
16 SYZ_S_PAIR, // Pre computation: s-pair
17 SYZ_RING_PAIR, // Pre computation: (module elem, ring elem)
18 SYZ_ONE_PAIR, // Pre computation: (module elem * variable)
19 SYZ_GEN, // Pre computation: original generator at level 1
20
22 SYZ_MINIMAL, // Post s-pair computation: element is minimal syzygy
23 SYZ_NOT_MINIMAL, // Post s-pair computation: element is not minimal
24 SYZ_NOT_NEEDED // S-pair computation for this pair cancelled
25};
26
28// Only do new and delete via res_comp::new_res_pair, res_comp::delete_res_pair
29{
30 public:
31 // The schreyer order part:
32
33 int me;
34 int compare_num; // Schreyer order of this stripped component
36
37 res_pair *next; // Next pair to compute in the same degree
38 res_pair *next_compare; // List of pairs in the level in ascending
39 // 'compare_num' value
44
45 MonomialIdeal *mi; // Monomial ideal of total monomials
46 res_pair *mi2; // List of res_pairs having this as lead term
47 res_pair *next_mi; // If this is part of a list of mi2, this is the
48 // next-link.
49 resterm *syz; // The syzygy itself, once computed
50
51 // The following are used only for minimalization of the resolution
52 int minimal_me; // SYZ_MINIMAL: the number of this min syzygy
53 resterm *pivot_term; // SYZ_NOT_MINIMAL: Points into 'syz', to the
54 // term containing the constant.
55 resterm *stripped_syz; // If syz_type is SYZ_MINIMAL: this is the
56 // reduced stripped version.
57 // If syz_type is SYZ_NOT_MINIMAL: this is the
58 // stripped (possibly reduced) version.
59};
60
68
70{
72 const Monoid *M;
73 const Ring *K; // Coefficient field of R.
76
77 resterm *new_term() const;
78
79 void sort(resterm *&f) const;
80
81 public:
83 ~res_poly();
84
85 const res_pair *lead_component(const resterm *f) const;
86 // int lead_coefficient(const resterm *f) const;
87 const int *lead_monomial(const resterm *f) const; // Lead TOTAL monomial
88
89 resterm *new_term(ring_elem c, const int *m, res_pair *comp) const;
90 resterm *mult_by_monomial(const resterm *f, const int *m) const;
91 void make_monic(resterm *&f) const;
92 resterm *mult_by_term(const resterm *f, ring_elem c, const int *m) const;
94 ring_elem c,
95 const int *m,
96 res_pair *x) const;
97 void add_to(resterm *&f, resterm *&g) const; // Destroys both f and g.
99 ring_elem c,
100 const int *m,
101 const resterm *g) const;
103 ring_elem c,
104 const int *m,
105 res_pair *x,
106 const ring_elem g) const;
107
108 int compare(const resterm *a, const resterm *b) const;
109
110 resterm *strip(const resterm *f) const;
111 const resterm *component_occurs_in(const res_pair *x, const resterm *f) const;
112
113 resterm *copy(const resterm *f) const;
114 void remove(resterm *&f) const;
115
116 vec to_vector(const resterm *f,
117 const FreeModule *F,
118 int to_minimal = 0) const;
119 resterm *from_vector(const VECTOR(res_pair *)& base, const vec v) const;
120
121 int n_terms(const resterm *f) const; // Used for stats
122 void elem_text_out(buffer &o,
123 const resterm *f) const; // Used for debugging and stats
124 void elem_text_out(const resterm *f) const; // Used for debugging and stats
125};
126
127inline const res_pair *res_poly::lead_component(const resterm *f) const
128{
129 return f->comp;
130}
131// inline int res_poly::lead_coefficient(const resterm *f) const { return
132// f->coeff; }
133inline const int *res_poly::lead_monomial(const resterm *f) const
134{
135 return f->monom;
136}
137
138#endif
139
140// Local Variables:
141// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
142// indent-tabs-mode: nil
143// End:
Engine-side free module R^n over a Ring.
Definition freemod.hpp:66
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
res_pair * next_compare
res_pair * second
res_pair * first
res_pair * next
int compare_num
resterm * pivot_term
resterm * syz
res_pair * base_comp
resterm * stripped_syz
res_pair * next_mi
MonomialIdeal * mi
res_pair * mi2
int * base_monom
const int * lead_monomial(const resterm *f) const
void elem_text_out(buffer &o, const resterm *f) const
const PolynomialRing * R
resterm * mult_by_term(const resterm *f, ring_elem c, const int *m) const
resterm * copy(const resterm *f) const
size_t element_size
resterm * mult_by_monomial(const resterm *f, const int *m) const
int n_terms(const resterm *f) const
int compare(const resterm *a, const resterm *b) const
stash * resterm_stash
resterm * from_vector(const VECTOR(res_pair *)&base, const vec v) const
void remove(resterm *&f) const
void sort(resterm *&f) const
res_poly(PolynomialRing *R)
void ring_subtract_multiple_to(resterm *&f, ring_elem c, const int *m, res_pair *x, const ring_elem g) const
vec to_vector(const resterm *f, const FreeModule *F, int to_minimal=0) const
resterm * strip(const resterm *f) const
const res_pair * lead_component(const resterm *f) const
resterm * ring_mult_by_term(const ring_elem f, ring_elem c, const int *m, res_pair *x) const
const resterm * component_occurs_in(const res_pair *x, const resterm *f) const
void make_monic(resterm *&f) const
const Ring * K
void add_to(resterm *&f, resterm *&g) const
void subtract_multiple_to(resterm *&f, ring_elem c, const int *m, const resterm *g) const
resterm * new_term() const
const Monoid * M
Definition mem.hpp:78
static CanonicalForm base
Definition factory.cpp:289
MonomialIdeal — exponent-vector-only representation of an ideal generated by monomials.
#define VECTOR(T)
Definition newdelete.hpp:78
volatile int x
@ SYZ_NOT_COMPUTED
@ SYZ_NOT_MINIMAL
@ SYZ_BASE_COMPONENT
@ SYZ_S_PAIR
@ SYZ_NOT_NEEDED
@ SYZ_RING_ELEM
@ SYZ_MINIMAL
@ SYZ_ONE_PAIR
@ SYZ_GEN
@ SYZ_EXTERIOR_VAR
@ SYZ_RING_PAIR
res_pair * comp
ring_elem coeff
int monom[1]
resterm * next