Macaulay2 Engine
Loading...
Searching...
No Matches

◆ new_pairs()

void GBKernelComputation::new_pairs ( int i)
private

Definition at line 184 of file Eschreyer.cpp.

187{
188 gc_vector<Bag*> elems;
189 gc_vector<int> vp; // This is 'p'.
190 gc_vector<int> thisvp;
191
192 if (SF)
193 {
195 SF->schreyer_down(gb[i]->monom, gb[i]->comp - 1, PAIRS_mon);
196 M->to_varpower(PAIRS_mon, vp);
197 }
198 else
199 M->to_varpower(gb[i]->monom, vp);
200
201 // First add in syzygies arising from exterior variables
202 // At the moment, there are none of this sort.
203
204 if (R->is_skew_commutative())
205 {
206 exponents_t find_pairs_exp = newarray_atomic(int, M->n_vars());
207
208 varpower::to_expvector(M->n_vars(), vp.data(), find_pairs_exp);
209 for (int w = 0; w < R->n_skew_commutative_vars(); w++)
210 if (find_pairs_exp[R->skew_variable(w)] > 0)
211 {
212 thisvp.resize(0);
213 varpower::var(w, 1, thisvp);
214 Bag *b = new Bag(static_cast<void *>(nullptr), thisvp);
215 elems.push_back(b);
216 }
217
218 freemem(find_pairs_exp);
219 }
220
221 // Second, add in syzygies arising from the base ring, if any
222 // The baggage of each of these is NULL
223 if (R->is_quotient_ring())
224 {
225 const MonomialIdeal *Rideal = R->get_quotient_monomials();
226 for (Bag& a : *Rideal)
227 {
228 // Compute (P->quotient_ideal->monom : p->monom)
229 // and place this into a varpower and Bag, placing
230 // that into 'elems'
231 thisvp.resize(0);
232 varpower::quotient(a.monom().data(), vp.data(), thisvp);
233 if (varpower::is_equal(a.monom().data(), thisvp.data()))
234 continue;
235 Bag *b = new Bag(static_cast<void *>(nullptr), thisvp);
236 elems.push_back(b);
237 }
238 }
239
240 // Third, add in syzygies arising from previous elements of this same level
241 // The baggage of each of these is their corresponding res2_pair
242
243 MonomialIdeal *mi_orig = mi[gb[i]->comp - 1];
244 for (Bag& a : *mi_orig)
245 {
246 Bag *b = new Bag();
247 varpower::quotient(a.monom().data(), vp.data(), b->monom());
248 elems.push_back(b);
249 }
250
251 // Make this monomial ideal, and then run through each minimal generator
252 // and insert into the proper degree. (Notice that sorting does not
253 // need to be done yet: only once that degree is about to begin.
254
255 mi_orig->insert_minimal(new Bag(i, vp));
256
257 MonomialIdeal *new_mi = new MonomialIdeal(R, elems);
258
259 monomial m = M->make_one();
260 for (Bag& a : *new_mi)
261 {
262 M->from_varpower(a.monom().data(), m);
263 M->mult(m, gb[i]->monom, m);
264
265 gbvector *q = make_syz_term(
266 GR->get_flattened_coefficients()->from_long(1), m, i + 1);
267 syzygies.push_back(q);
268 }
269}
exponents::Exponents exponents_t
static void quotient(ConstExponents a, ConstExponents b, Vector &result)
static bool is_equal(ConstExponents a, ConstExponents b)
static void to_expvector(int n, ConstExponents a, exponents::Exponents result)
static void var(Exponent v, Exponent e, Vector &result)
gc_vector< gbvector * > syzygies
Definition Eschreyer.hpp:99
const SchreyerOrder * SF
Definition Eschreyer.hpp:91
const PolynomialRing * R
Definition Eschreyer.hpp:87
gc_vector< gbvector * > gb
Definition Eschreyer.hpp:98
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
gc_vector< int > & monom()
Definition int-bag.hpp:60
#define monomial
Definition gb-toric.cpp:11
int_bag Bag
Definition int-bag.hpp:70
void freemem(void *s)
Definition m2-mem.cpp:103
#define ALLOCATE_MONOMIAL(byte_len)
Definition monoid.hpp:65
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
#define newarray_atomic(T, len)
Definition newdelete.hpp:91

References ALLOCATE_MONOMIAL, freemem(), gb, GR, MonomialIdeal::insert_minimal(), ExponentList< int, true >::is_equal(), M, make_syz_term(), mi, int_bag::monom(), monom_size, monomial, newarray_atomic, ExponentList< int, true >::quotient(), R, SF, syzygies, ExponentList< int, true >::to_expvector(), and ExponentList< int, true >::var().

Referenced by calc().