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

◆ QRingInfo_field()

QRingInfo_field::QRingInfo_field ( const PolyRing * ambientR,
const VECTOR(Nterm *) & quotients )

Definition at line 43 of file qring.cpp.

45 : QRingInfo(ambientR)
46// This constructs the quotient ideal, and sets the MonomialIdeal.
47// A subset of 'quotients' must be a minimal GB, and any non-minimal elements
48// should be writable in terms of previous ones.
49// IE, in constructing (R/I)/J, the GB elements of J (mod I), together with the
50// GB elements of I, form a GB, but the GB elements of I might not be minimal.
51// In this case, 'quotients' should be the list of GB elements of J followed by
52// those
53// of I.
54//
55// The ideal may be in a tower of polynomial rings, in which case it needs to be
56// a GB over the flattened ring.
57{
58 Rideal = new MonomialIdeal(R);
59 ringtable = MonomialTable::make(R->n_vars());
60 gc_vector<int> vp;
61 exponents_t exp = newarray_atomic(int, R->n_vars());
62 for (int i = 0; i < quotients.size(); i++)
63 {
64 // Make a varpower element. See if it is in Rideal.
65 // If not, place it into quotient_elements_.
66
67 Nterm *f = quotients[i];
68 R->getMonoid()->to_expvector(f->monom, exp);
69
70 Bag *not_used;
71
72 if (!Rideal->search_expvector(exp, not_used))
73 {
74 // The element is part of a minimal GB
75 int index = n_quotients();
76 gbvector *g = R->translate_gbvector_from_ringelem(f);
78 R->getMonoid()->to_varpower(f->monom, vp);
79 Bag *b = new Bag(index, vp);
80 Rideal->insert(b);
81 ringtable->insert(exp, 1, index); // consumes exp
82 exp = newarray_atomic(int, R->n_vars());
83 }
84 }
85 freemem(exp);
86}
exponents::Exponents exponents_t
static MonomialTable * make(int nvars)
Definition montable.cpp:61
MonomialTable * ringtable
Definition qring.hpp:154
MonomialIdeal * Rideal
Definition qring.hpp:153
int n_quotients() const
Definition qring.hpp:97
QRingInfo()
Definition qring.hpp:93
const PolyRing * R
Definition qring.hpp:83
void appendQuotientElement(Nterm *f, gbvector *g)
Definition qring.cpp:12
int_bag Bag
Definition int-bag.hpp:70
void freemem(void *s)
Definition m2-mem.cpp:103
const mpreal exp(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
Definition mpreal.h:2298
#define newarray_atomic(T, len)
Definition newdelete.hpp:91
int monom[1]
Definition ringelem.hpp:160

References QRingInfo::appendQuotientElement(), freemem(), MonomialTable::make(), Nterm::monom, QRingInfo::n_quotients(), newarray_atomic, QRingInfo::QRingInfo(), QRingInfo::R, Rideal, and ringtable.

Referenced by QRingInfo_field_basic::QRingInfo_field_basic(), and QRingInfo_field_QQ::QRingInfo_field_QQ().