26 _maxCount(translator.getVarCount()),
27 _lcm(translator.getVarCount()),
28 _outputMultivariate(translator.getVarCount()),
29 _computeUnivariate(false),
30 _translator(translator),
31 _totalBaseCasesEver(0),
32 _totalTermsOutputEver(0),
65 for (; it != end; ++it) {
67 for (
size_t var = 0; var < state.
getVarCount(); ++var) {
69 if ((*it)[var] ==
_lcm[var] &&
_lcm[var] > 0) {
88 fputs(
"Debug: Outputting term ", stderr);
89 fputc(plus ?
'+' :
'-', stderr);
100 for (
size_t var = 1; var < term.
getVarCount(); ++var)
109 bool inCanonicalOrder) {
184 for (
size_t var = 0; var < max.
getVarCount(); ++var)
186 if (
_tmp > 1024*1024)
189 size_t maxDegree =
_tmp.get_ui();
192 if (approxWorkForScarfComplex < maxDegree)
200 poly.reserve(maxDegree);
211 for (
size_t var = 0; var < max.
getVarCount(); ++var)
216 size_t oldSize = poly.size();
217 poly.resize(oldSize + degree);
218 for (
size_t e = oldSize; e > 0;) {
220 poly[e+degree] -= poly[e];
225 for (
size_t var = 0; var < max.
getVarCount(); ++var)
228 for (
size_t e = 0; e < poly.size(); ++e) {
230 fprintf(stderr,
"Debug: Outputting term %i*t^%u.\n",
231 poly[e], (
unsigned int)(e + degree));
255 for (
size_t i = 0; i <
_states.size(); ++i)
274 if (currentState.
pos == stop) {
300 next.
pos = currentState.
pos;
BigattiBaseCase(const TermTranslator &translator)
Initialize this object to handle the computation of Hilbert-Poincare series numerator polynomials in ...
size_t _totalBaseCasesEver
For statistics.
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
void setPrintDebug(bool value)
Starts to print debug output on what happens if value is true.
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
bool univariateAllFaces(const BigattiState &state)
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
void setComputeUnivariate(bool value)
Use the fine grading if value is false, otherwise grade each variable by the same variable t.
vector< size_t > _maxCount
bool simpleBaseCase(const BigattiState &state)
Computes the Hilbert-Poincare series of state and returns true if state is a particularly simple and ...
bool _computeUnivariate
Use the fine grading if false, otherwise grade each variable by the same variable t.
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
void enumerateScarfComplex(const BigattiState &state, bool allFaces)
The ideal in state must be weakly generic.
HashPolynomial _outputMultivariate
The part of the finely graded Hilbert-Poincare numerator polynomial computed so far.
const TermTranslator & _translator
Used to translate the output from ints.
size_t _totalTermsOutputEver
For statistics.
vector< State > _states
Used in enumerateScarfCompex.
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
UniHashPolynomial _outputUnivariate
The part of the coarsely graded Hilbert-Poincare numerator polynomial computed so far.
void feedOutputTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder)
Feed the output Hilbert-Poincare numerator polynomial computed so far to the consumer.
size_t getTotalTermsInOutput() const
Returns the number of terms in the output polynomial right now.
const Term & getMultiply() const
size_t getVarCount() const
const Ideal & getIdeal() const
void add(const mpz_class &coef, const Term &term)
Add coef*term to the polynomial.
size_t getTermCount() const
void feedTo(const TermTranslator &translator, CoefBigTermConsumer &consumer, bool inCanonicalOrder) const
Represents a monomial ideal with int exponents.
size_t getGeneratorCount() const
void getLcm(Exponent *lcm) const
Sets lcm to the least common multiple of all generators.
Cont::const_iterator const_iterator
bool strictlyContains(const Exponent *term) const
bool disjointSupport() const
Returns true if all pairs of generators have disjoint support.
const_iterator end() const
const_iterator begin() const
bool isWeaklyGeneric() const
size_t getVarCount() const
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
const mpz_class & getExponent(size_t variable, Exponent exponent) const
This method translates from IDs to arbitrary precision integers.
Term represents a product of variables which does not include a coefficient.
static size_t getSizeOfSupport(const Exponent *a, size_t varCount)
Returns the number of variables such that divides .
static void product(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the product of a and b.
size_t getVarCount() const
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
static void lcm(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the least commom multiple of a and b.
size_t getTermCount() const
void feedTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder=false) const
void add(bool plus, const mpz_class &exponent)
Add +t^exponent or -t^exponent to the polynomial depending on whether plus is true or false,...
Used in enumerateScarfComplex and necessary to have here to define _states.
Ideal::const_iterator pos