27 (auto_ptr<Ideal> ideal,
30 auto_ptr<BigattiPivotStrategy> pivot,
32 _translator(translator),
34 _baseCase(translator),
36 _computeUnivariate(false),
40 ASSERT(ideal->isMinimallyGenerated());
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();
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.
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.
bool baseCase(const BigattiState &state)
Returns true if state is a base case slice without considering genericity.
void output(bool plus, const Term &term)
Add +term or -term to the output polynomial when plus is true or false respectively.
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.
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.
void freeState(auto_ptr< BigattiState > state)
auto_ptr< BigattiPivotStrategy > _pivot
CoefBigTermConsumer * _consumer
BigattiBaseCase _baseCase
void simplify(BigattiState &state)
void processState(auto_ptr< BigattiState > state)
void setComputeUnivariate(bool value)
ObjectCache< BigattiState > _stateCache
friend class BigattiState
bool getUseGenericBaseCase() const
Returns whether to detect generic monomial ideals as a base case.
void colonStep(const Term &term)
const Term & getMultiply() const
const Ideal & getIdeal() const
bool getPrintStatistics() const
Returns whether to print statistics on what the algorithm did to standard error after it has run.
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.
void getGcd(Exponent *gcd) const
Sets gcd to the greatest common divisor of all generators.
auto_ptr< T > newObjectCopy(const S ©Of)
Returns a copy of copyOf.
void freeObject(auto_ptr< S > object)
Insert an object into the cache.
bool getUseSimplification() const
Apply simplification to the state of the algorithm when possible.
void addTask(Task *task)
Add a task at the head of the list of pending tasks.
size_t getTotalTasksEver()
Returns the number of times addTask has been successfully called.
void runTasks()
Runs all pending tasks.
TermTranslator handles translation between terms whose exponents are infinite precision integers and ...
Term represents a product of variables which does not include a coefficient.
void reset(size_t newVarCount)
static void print(FILE *file, const Exponent *e, size_t varCount)
Writes e to file in a format suitable for debug output.
static bool isIdentity(const Exponent *a, size_t varCount)
Returns whether a is 1, i.e. whether all entries of a are 0.
void gcd(Word *res, const Word *resEnd, const Word *a, const Word *b)