27 (auto_ptr<Ideal> ideal,
30 auto_ptr<BigattiPivotStrategy> pivot,
32 _translator(translator),
34 _baseCase(translator),
36 _computeUnivariate(
false),
40 ASSERT(ideal->isMinimallyGenerated());
41 _varCount = ideal->getVarCount();
42 _tmp_simplify_gcd.reset(_varCount);
44 _baseCase.setPrintDebug(_params.getPrintDebug());
56 _pivot = BigattiPivotStrategy::createStrategy(
"median",
true);
63 fputs(
"*** Statistics for run of Bigatti algorithm ***\n", stderr);
64 fprintf(stderr,
" %u states processed.\n",
66 fprintf(stderr,
" %u base cases.\n",
68 fprintf(stderr,
" %u terms output.\n",
70 fprintf(stderr,
" %u terms in final output.\n",
80 fputs(
"Debug: Processing state.\n", stderr);
94 fputs(
"Debug: Performing pivot split on ", stderr);
99 ASSERT(!state->getIdeal().contains(pivot));
102 colonState->colonStep(pivot);
105 state->addStep(pivot);
126 state->getIdeal().clear();
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
void processState(auto_ptr< BigattiState > state)
BigattiBaseCase _baseCase
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
void colonStep(const Term &term)
size_t getVarCount() const
void simplify(BigattiState &state)
bool getUseSimplification() const
Apply simplification to the state of the algorithm when possible.
const Term & getMultiply() const
auto_ptr< BigattiPivotStrategy > _pivot
void getGcd(Exponent *gcd) const
Sets gcd to the greatest common divisor of all generators.
bool getPrintStatistics() const
Returns whether to print statistics on what the algorithm did to standard error after it has run...
bool getUseGenericBaseCase() const
Returns whether to detect generic monomial ideals as a base case.
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)
void freeObject(auto_ptr< S > object)
Insert an object into the cache.
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
void feedOutputTo(CoefBigTermConsumer &consumer, bool inCanonicalOrder)
Feed the output Hilbert-Poincare numerator polynomial computed so far to the consumer.
void runTasks()
Runs all pending tasks.
const Ideal & getIdeal() const
auto_ptr< T > newObjectCopy(const S ©Of)
Returns a copy of copyOf.
void setComputeUnivariate(bool value)
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
void setComputeUnivariate(bool value)
Use the fine grading if value is false, otherwise grade each variable by the same variable t...
void freeState(auto_ptr< BigattiState > state)
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
BigattiHilbertAlgorithm(auto_ptr< Ideal > ideal, const TermTranslator &translator, const BigattiParams ¶ms, auto_ptr< BigattiPivotStrategy > pivot, CoefBigTermConsumer &consumer)
Construct an object for running the Bigatti et.al.
size_t getTotalTasksEver()
Returns the number of times addTask has been successfully called.
void addTask(Task *task)
Add a task at the head of the list of pending tasks.
CoefBigTermConsumer * _consumer
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
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.
ObjectCache< BigattiState > _stateCache
bool getPrintDebug() const
Returns whether to print information about what the algorithm is doing to standard error as it runs...
bool getProduceCanonicalOutput() const
Returns whether to produce output in a canonical representation.