148 std::vector<int> heftvec,
149 std::vector<int> varlist,
162 std::vector<int> heftvec,
163 std::vector<int> varlist,
169 const int *lo_degree0,
170 const int *hi_degree0,
171 std::vector<int> heftvec,
172 std::vector<int> varlist,
185 P = bottom->
get_ring()->cast_to_PolynomialRing();
187 D =
P->get_degree_ring()->getMonoid();
190 else if (
mHeftVector.size() == 1) { computation_type = KB_SINGLE; }
191 else { computation_type = KB_MULTI; }
204 D->to_expvector(
M->degree_of_var(v), exp);
264 if (curr < 0)
return false;
345 if (curr < 0)
return false;
399 std::vector<int> varlist)
404 for (
int i = 0; i < lcms.size(); i++) exp[i] = 0;
405 for (
int i = 0; i < varlist.size(); i++)
424 if (
limit == 0)
return;
425 std::vector<int> zero_vars;
430 if (
var_wts[i] == 0) { zero_vars.push_back(i); }
453 ERROR(
"module given is not finite over the base");
457 else if (zero_vars.size() > 0)
465 "module given is not finite over the zero-degree variables");
470 const int *component_degree =
bottom_matrix->rows()->degree(i);
494 std::vector<int> heftvec,
495 std::vector<int> varlist,
525 if (
P ==
nullptr)
return Matrix::identity(bottom->
rows());
531 if (heftvec.size() >
D->n_vars())
533 ERROR(
"expected heft vector of length <= %d",
D->n_vars());
537 if (lo && heftvec.size() !=
lo_degree->len)
539 ERROR(
"expected degrees of length %d", heftvec.size());
543 if (hi && heftvec.size() !=
hi_degree->len)
545 ERROR(
"expected degrees of length %d", heftvec.size());
551 if (heftvec.size() > 1 && lo && hi)
552 for (
int i = 0; i < heftvec.size(); i++)
555 ERROR(
"expected degree bounds to be equal");
564 for (
int i = 0; i < varlist.size(); i++)
568 "basis: computation requires a heft form non-negative on the "
569 "degrees of the variables");
575 if (lo !=
nullptr && hi !=
nullptr && lo[0] > hi[0])
return KB.
value();
592 this, lo_degree, hi_degree, heft, vars, do_truncation, limit);
exponents::Exponents exponents_t
Dense exponent-vector template [e_0, ..., e_{nvars-1}] for monomial operations.
static Exponent weight(int nvars, ConstExponents a, const std::vector< Exponent > &wts)
static void divide(int nvars, ConstExponents a, ConstExponents b, Exponents result)
static void mult(int nvars, ConstExponents a, ConstExponents b, Exponents result)
static void copy(int nvars, ConstExponents a, Exponents result)
static void multpower(int nvars, ConstExponents a, ConstExponents b, const Exponent n, Exponents result)
static int lex_compare(int nvars, ConstExponents a, ConstExponents b)
const Matrix * bottom_matrix
std::vector< int > mVariables
MonomialIdeal * kb_monideal
bool backtrack_mg(int &curr)
bool backtrack(int &curr)
enum KBasis::@037164154004220152265360251131226313056117246356 computation_type
std::vector< int > mHeftVector
int * kb_target_multidegree
static Matrix * k_basis(const Matrix *bottom, M2_arrayint lo_degree, M2_arrayint hi_degree, std::vector< int > heftvec, std::vector< int > varlist, bool do_truncation, int limit)
void basis0_singly_graded()
KBasis(const Matrix *bottom, const int *lo_degree, const int *hi_degree, std::vector< int > heftvec, std::vector< int > varlist, bool do_truncation, int limit)
void basis0_multi_graded()
const Ring * get_ring() const
Matrix(const FreeModule *rows, const FreeModule *cols, const_monomial degree_shift, VECTOR(vec) &entries)
const FreeModule * rows() const
const Matrix * basis(M2_arrayint lo_degree, M2_arrayint hi_degree, M2_arrayint wt, M2_arrayint vars, bool do_truncation, int limit) const
Mutable builder used to assemble an immutable Matrix one column (or one term) at a time.
Engine-side commutative monomial monoid: variable names, ordering, multidegree machinery,...
int search_expvector(const_exponents m, Bag *&b) const
Engine-side monomial ideal: a decision tree of Nmi_nodes storing the (typically minimal) generators b...
Abstract base for the engine's polynomial-ring hierarchy.
virtual const PolynomialRing * cast_to_PolynomialRing() const
Engine-wide include prelude — a single point of truth for portability shims.
Engine error-reporting primitives: ERROR, INTERNAL_ERROR, error, error_message.
FreeModule — finite-rank free module R^n, the type-level anchor for every Matrix.
int_bag / Bag — minimal (payload, varpower monomial) carrier shared by monomial-ideal code.
bool system_interrupted()
system_interrupted() — thread-safe polling predicate for Ctrl+C handling.
Engine-wide GC allocator surface (getmem / getmem_atomic) and debug-allocation trap.
MatrixConstructor — the mutable builder that produces an immutable Matrix.
static bool all_have_pure_powers(const MonomialIdeal *M, std::vector< int > varlist)
Matrix — the engine's immutable homomorphism F -> G between free modules.
MonomialIdeal — exponent-vector-only representation of an ideal generated by monomials.
#define ALLOCATE_EXPONENTS(byte_len)
#define EXPONENT_BYTE_SIZE(nvars)
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
#define newarray_atomic_clear(T, len)
#define newarray_atomic(T, len)
our_new_delete — per-class opt-in routing of new / delete through bdwgc.
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
Ring — the legacy abstract base class for every coefficient and polynomial ring.
ring_elem — the universal value type carried by every Ring* in the engine.
Engine-wide stylistic constants: LT / EQ / GT codes, INTSIZE, GEOHEAP_SIZE.
std::vector< T > M2_arrayint_to_stdvector(M2_arrayint arr)
Conversion helpers between M2 boundary types and standard C++ containers.