Go to the documentation of this file.
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) {
110 if (_computeUnivariate)
111 _outputUnivariate.feedTo(consumer, inCanonicalOrder);
113 _outputMultivariate.feedTo(_translator, consumer, 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;
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
size_t getTermCount() const
static size_t getSizeOfSupport(const Exponent *a, size_t varCount)
Returns the number of variables such that divides .
bool strictlyContains(const Exponent *term) const
const TermTranslator & _translator
Used to translate the output from ints.
Cont::const_iterator const_iterator
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.
const_iterator begin() const
size_t getVarCount() const
vector< size_t > _maxCount
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
void setComputeUnivariate(bool value)
Use the fine grading if value is false, otherwise grade each variable by the same variable t.
bool _computeUnivariate
Use the fine grading if false, otherwise grade each variable by the same variable t.
Ideal::const_iterator pos
const mpz_class & getExponent(size_t variable, Exponent exponent) const
This method translates from IDs to arbitrary precision integers.
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
static void product(Exponent *res, const Exponent *a, const Exponent *b, size_t varCount)
Sets res equal to the product of a and b.
bool simpleBaseCase(const BigattiState &state)
Computes the Hilbert-Poincare series of state and returns true if state is a particularly simple and ...
vector< State > _states
Used in enumerateScarfCompex.
size_t getGeneratorCount() const
const_iterator end() const
size_t getTermCount() const
void setPrintDebug(bool value)
Starts to print debug output on what happens if value is true.
bool disjointSupport() const
Returns true if all pairs of generators have disjoint support.
Used in enumerateScarfComplex and necessary to have here to define _states.
size_t _totalBaseCasesEver
For statistics.
void feedOutputTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder)
Feed the output Hilbert-Poincare numerator polynomial computed so far to the consumer.
Term represents a product of variables which does not include a coefficient.
const Term & getMultiply() const
size_t getVarCount() const
const Ideal & getIdeal() const
HashPolynomial _outputMultivariate
The part of the finely graded Hilbert-Poincare numerator polynomial computed so far.
bool isWeaklyGeneric() const
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
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,...
UniHashPolynomial _outputUnivariate
The part of the coarsely graded Hilbert-Poincare numerator polynomial computed so far.
Represents a monomial ideal with int exponents.
void enumerateScarfComplex(const BigattiState &state, bool allFaces)
The ideal in state must be weakly generic.
void getLcm(Exponent *lcm) const
Sets lcm to the least common multiple of all generators.
BigattiBaseCase(const TermTranslator &translator)
Initialize this object to handle the computation of Hilbert-Poincare series numerator polynomials in ...
size_t getTotalTermsInOutput() const
Returns the number of terms in the output polynomial right now.
bool univariateAllFaces(const BigattiState &state)
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
size_t getVarCount() const
size_t _totalTermsOutputEver
For statistics.
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
void add(const mpz_class &coef, const Term &term)
Add coef*term to the polynomial.