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