Go to the documentation of this file.
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);
114 if (!
gcd.isIdentity()) {
126 state->getIdeal().clear();
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
bool getUseSimplification() const
Apply simplification to the state of the algorithm when possible.
auto_ptr< BigattiPivotStrategy > _pivot
void freeObject(auto_ptr< S > object)
Insert an object into the cache.
BigattiBaseCase _baseCase
void processState(auto_ptr< BigattiState > state)
bool getUseGenericBaseCase() const
Returns whether to detect generic monomial ideals as a base case.
size_t getTotalBaseCasesEver() const
Returns the total number of base cases this object has seen.
auto_ptr< T > newObjectCopy(const S ©Of)
Returns a copy of copyOf.
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.
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
void addTask(Task *task)
Add a task at the head of the list of pending tasks.
void getGcd(Exponent *gcd) const
Sets gcd to the greatest common divisor of all generators.
void colonStep(const Term &term)
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
bool getPrintDebug() const
Returns whether to print information about what the algorithm is doing to standard error as it runs.
const Ideal & getIdeal() const
size_t getTotalTasksEver()
Returns the number of times addTask has been successfully called.
void setComputeUnivariate(bool value)
CoefBigTermConsumer * _consumer
bool getProduceCanonicalOutput() const
Returns whether to produce output in a canonical representation.
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
void runTasks()
Runs all pending tasks.
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.
bool getPrintStatistics() const
Returns whether to print statistics on what the algorithm did to standard error after it has run.
void freeState(auto_ptr< BigattiState > state)
size_t getTotalTermsInOutput() const
Returns the number of terms in the output polynomial right now.
size_t getTotalTermsOutputEver() const
Returns the total number of terms this object has output.
ObjectCache< BigattiState > _stateCache
bool genericBaseCase(const BigattiState &state)
Returns ture if state is a base case slice while also considering genericity.
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)
void simplify(BigattiState &state)