44 g->receive_generator(v,
these[
n_i], denom);
60 for (
int i = 0; i <
gens->n_cols(); i++)
90 ERROR(
"resolution length must be at least 1");
97 if (length > 1 && origsyz > 0)
102 for (i = 0; i < origsyz; i++)
104 if ((*m)[i] ==
nullptr)
129 nodes[1]->set_output(
nullptr);
136 if (origsyz > 0) deg--;
137 for (i = 2; i <
n_nodes - 1; i++)
154 setup(m, length, origsyz, strategy);
164 setup(m, length, origsyz, strategy);
170 for (
int i = 0; i <
n_nodes; i++)
172 nodes[i]->set_output(
nullptr);
183 if (
stop_.length_limit !=
nullptr &&
stop_.length_limit->len > 0)
185 ERROR(
"cannot change length of resolution using this algorithm");
203 if (
stop_.stop_after_degree &&
stop_.degree_limit->array[0] < i)
212 o <<
"{" << i <<
"}";
231 for (
int i = 0; i <
n_nodes; i++)
244 ERROR(
"expected matrices to have same number of rows");
250 for (
int i = 0; i < m->
n_cols(); i++)
258 nodes[1]->reduce(f, fsyz);
260 vec fv =
originalR->translate_gbvector_to_vec_denom(F, f, denom);
261 GR->get_flattened_coefficients()->negate_to(denom);
262 vec fsyzv =
originalR->translate_gbvector_to_vec_denom(Fsyz, fsyz, denom);
276 if (level >= 0 && level <=
n_nodes - 1)
278 return nodes[0]->output_free_module()->get_ring()->make_FreeModule();
282 if (level <= 0 || level >=
n_nodes)
284 return nodes[level]->min_gens_matrix();
288 if (level <= 0 || level >=
n_nodes)
290 return nodes[level]->get_matrix();
295 if (level <= 0 || level >=
n_nodes)
297 return nodes[level]->initial_matrix(n);
302 if (level <= 0 || level >=
n_nodes)
304 return nodes[level]->gb_matrix();
309 if (level <= 0 || level >=
n_nodes)
311 return nodes[level]->change_matrix();
317 " #gb #pair #comp m z o u #hilb #gcd #mons #chg");
322 o <<
" #gb #pair #comp m z o u #hilb #gcd #mons #chg";
330 int lo =
nodes[0]->output_free_module()->lowest_primary_degree();
333 int lo1 =
nodes[1]->output_free_module()->lowest_primary_degree() - 1;
334 if (lo1 < lo) lo = lo1;
338 int lo2 =
nodes[2]->output_free_module()->lowest_primary_degree() - 2;
339 if (lo2 < lo) lo = lo2;
345 for (lev = 0; lev <
n_nodes; lev++)
348 if (F->
rank() > 0) len = lev;
350 for (i = 0; i < F->
rank(); i++)
360 for (lev = 0; lev <= len; lev++)
364 for (i = 0; i < F->
rank(); i++)
367 bettis[lev + (len + 1) * d]++;
384 "cannot use Minimize=>true unless res(...,FastNonminimal=>true) was "
389 ERROR(
"received unsupported betti type for this algorithm");
enum ComputationStatusCode set_status(enum ComputationStatusCode)
const_monomial degree(int i) const
int primary_degree(int i) const
int lowest_primary_degree() const
void append_schreyer(const_monomial d, const_monomial base_monom, int compare_num)
Engine-side free module R^n over a Ring.
const_monomial degree_shift() const
const Ring * get_ring() const
const FreeModule * rows() const
const FreeModule * cols() const
void set_column(int c, vec v)
Mutable builder used to assemble an immutable Matrix one column (or one term) at a time.
Internal tree node of the MonomialIdeal decision tree.
static void betti_init(int lo, int hi, int len, int *&bettis)
static M2_arrayint betti_make(int lo, int hi, int len, int *bettis)
virtual const PolynomialRing * cast_to_PolynomialRing() const
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
int start_degree(int deg)
virtual void text_out(buffer &o) const
gb_emitter(const Matrix *m)
virtual enum ComputationStatusCode calc_gens(int degree)
virtual RingElement * hilbertNumerator()
virtual enum ComputationStatusCode calc_gb(int degree)
virtual void stats() const
const PolynomialRing * originalR
gbres_comp(const Matrix *m, int length, int orig_syz, int strategy)
const Matrix * change_matrix(int level)
const Matrix * get_matrix(int level)
void text_out(buffer &o) const
M2_arrayint get_betti(int type) const
const FreeModule * free_module(int level) const
const Matrix * min_gens_matrix(int level)
bool stop_conditions_ok()
void setup(const Matrix *m, int length, int origsyz, int strategy)
const PolynomialRing * originalR
Matrix * reduce(const Matrix *m, Matrix *&lift)
M2_arrayint betti_minimal() const
const Matrix * gb_matrix(int level)
const Matrix * initial_matrix(int n, int level)
int complete_thru_degree() const
int last_completed_degree
Hilbert-series numerator via the Bigatti-Caboara-Robbiano recursion.
bool system_interrupted()
system_interrupted() — thread-safe polling predicate for Ctrl+C handling.
VALGRIND_MAKE_MEM_DEFINED & result(result)
MatrixConstructor — the mutable builder that produces an immutable Matrix.
#define newarray_atomic_clear(T, len)
ring_elem hilb(const Matrix &M, const Ring *RR)
Singly linked-list node carrying one term of a polynomial-ring element.
void emit_line(const char *s)
Text-formatting helpers layered on buffer: bignum print, line wrapping, M2_gbTrace-gated emit.