51 Facade(params.getPrintActions()),
60 Facade(params.getPrintActions()),
69 Facade(params.getPrintActions()),
80 beginAction(
"Computing multigraded Hilbert-Poincare series.");
85 consumer->beginConsuming();
88 consumer->doneConsuming();
95 beginAction(
"Computing univariate Hilbert-Poincare series.");
97 auto_ptr<CoefTermConsumer> consumer =
101 consumer->beginConsuming();
104 consumer->doneConsuming();
135 mpz_class minusCodimension;
145 return -minusCodimension;
147 return v.size() + minusCodimension;
155 Ideal irreducibleDecom(varCount);
162 (
"Computing primary decomposition from irreducible decomposition.");
181 Term support(varCount);
185 Ideal primaryComponent(varCount);
191 consumer->beginConsumingList();
200 primaryComponentDual.
insert(tmp);
212 consumer->beginConsuming();
214 dualTerm != primaryComponent.
end(); ++dualTerm) {
216 consumer->consume(tmp);
218 consumer->doneConsuming();
220 primaryComponent.
clear();
221 primaryComponentDual.
clear();
224 consumer->doneConsumingList();
231 beginAction(
"Computing maximal staircase monomials.");
244 beginAction(
"Preparing to compute maximal standard monomials.");
254 beginAction(
"Ensuring specified point is divisible by lcm.");
255 vector<mpz_class>
lcm;
258 for (
size_t var = 0; var <
lcm.size(); ++var) {
259 if (
lcm[var] > point[var]) {
262 (
"The specified point to dualize on is not divisible by the "
263 "least common multiple of the minimal generators of the ideal.");
268 beginAction(
"Preparing to compute Alexander dual.");
279 vector<mpz_class>
lcm;
292 Ideal radical(varCount);
294 Ideal decom(varCount);
298 beginAction(
"Computing associated primes from irreducible decomposition.");
303 for (
size_t var = 0; var < varCount; ++var) {
324 consumer->beginConsuming();
329 consumer->consume(tmp);
331 consumer->doneConsuming();
337 (
const vector<mpz_class>& grading,
338 mpz_class& optimalValue,
339 bool reportAllSolutions) {
343 beginAction(
"Preparing to solve optimization program.");
348 return solveProgram(grading, optimalValue, reportAllSolutions);
352 (
const vector<mpz_class>& grading,
353 mpz_class& optimalValue,
354 bool reportAllSolutions) {
359 return solveProgram(grading, optimalValue, reportAllSolutions);
364 beginAction(
"Computing irreducible decomposition.");
376 mpz_class& optimalValue,
377 bool reportAllSolutions) {
383 (
"Turning off Independence splits as they are not supported\n"
384 "for optimization.");
391 (
"Bound simplification requires using the bound to eliminate\n"
392 "non-improving slices, which has been turned off. Am now turning\n"
410 (grader,
_split.get(), reportAllSolutions, boundSetting);
419 consumer->consume(solution);
441 if (
lcm.isSquareFree())
474 auto_ptr<SliceStrategy> debugStrategy;
477 (
new DebugStrategy(strategyWithOptions, stderr));
478 strategyWithOptions = debugStrategy.get();
481 auto_ptr<SliceStrategy> statisticsStrategy;
483 statisticsStrategy.reset
485 strategyWithOptions = statisticsStrategy.get();
488 ASSERT(strategyWithOptions != 0);
void setToZeroOne(TermTranslator &translator)
TermTranslator & getTranslator()
void addPurePowersAtInfinity()
auto_ptr< TermConsumer > makeTranslatedIdealConsumer(bool split=false)
const VarNames & getNames()
void setIdealAndIdealOutput(const CommonParams ¶ms, const BigIdeal &input, BigTermConsumer &output)
Use given ideal and support ideal output.
auto_ptr< CoefTermConsumer > makeToUnivariatePolyConsumer()
void readIdealAndSetOutput(const CommonParams ¶ms, const DataType &output)
Read input ideal and support specified kind of output.
void setIdealAndPolyOutput(const CommonParams ¶ms, const BigIdeal &input, CoefBigTermConsumer &output)
Use given ideal and support polynomial output.
auto_ptr< CoefTermConsumer > makeTranslatedPolyConsumer()
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.
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
This is the super class of all facades.
void beginAction(const char *message)
Prints message to standard error if printing is turned on, and records the time when the action start...
void endAction()
Prints to standard error the time since the last call to beginAction.
Represents a monomial ideal with int exponents.
bool containsIdentity() const
void getLcm(Exponent *lcm) const
Sets lcm to the least common multiple of all generators.
void takeRadicalNoMinimize()
Replaces all generators with their support and does not remove any non-minimal generators this may pr...
Cont::const_iterator const_iterator
void insert(const Exponent *term)
const_iterator end() const
const_iterator begin() const
size_t getVarCount() const
OptimizeStrategy optimizes a function on the maximal standard monomials of a monomial ideal using bra...
BoundSetting
The values of BoundSetting indicate how to use the bound.
@ DoNotUseBound
Make no use of the bound.
@ UseBoundToEliminateAndSimplify
Eliminate non-improving slices and simplify slices by trying to generate non-improving slices that ar...
@ UseBoundToEliminate
Eliminate non-improving slices, achieving a branch-and-bound algorithm in place of the usual backtrac...
const Ideal & getMaximalSolutions()
Returns one of or all of the msm's with optimal value found so far, depending on the value of reportA...
const mpz_class & getMaximalValue()
The optimal value associated to all entries from getMaximalSolutions().
void computeAssociatedPrimes()
Compute the associated primes of the ideal.
void runSliceAlgorithmWithOptions(SliceStrategy &strategy)
void computeMultigradedHilbertSeries()
Compute the numerator of the multigraded Hilbert-Poincare series.
bool solveStandardProgram(const vector< mpz_class > &grading, mpz_class &value, bool reportAllSolutions)
Solve an optimization program over maximal standard monomials.
bool solveIrreducibleDecompositionProgram(const vector< mpz_class > &grading, mpz_class &optimalValue, bool reportAllSolutions)
Solve an optimization program over irreducible components.
bool isFirstComputation() const
CommonParamsHelper _common
void getLcmOfIdeal(vector< mpz_class > &lcm)
mpz_class computeDimension(bool codimension=false)
Compute the Krull dimension of ideal.
SliceFacade(const SliceParams ¶ms, const DataType &output)
void computeUnivariateHilbertSeries()
Compute the numerator of the univariate Hilbert-Poincare series.
auto_ptr< SplitStrategy > _split
void computePrimaryDecomposition()
Compute the unique "nicest" primary decomposition of the ideal.
bool solveProgram(const vector< mpz_class > &grading, mpz_class &optimalValue, bool reportAllSolutions)
void computeIrreducibleDecomposition(bool encode)
Compute the unique irredundant set of irreducible ideals whose intersection equals ideal.
void computeMaximalStaircaseMonomials()
Compute the maximal staircase monomials of the ideal.
void computeMaximalStandardMonomials()
Compute the maximal standard monomials of the ideal.
void produceEncodedIrrDecom(TermConsumer &consumer)
void computeAlexanderDual()
Compute the Alexander dual of the ideal.
bool getUseSimplification() const
Apply simplification to the state of the algorithm when possible.
void useIndependenceSplits(bool value)
bool getUseIndependenceSplits() const
void useBoundElimination(bool value)
bool getUseBoundSimplification() const
Returns whether to simplify slices by seeking to generate non-improving slices that are then eliminat...
bool getUseBoundElimination() const
Returns whether to use branch-and-bound to speed up Slice optimization computations by eliminating no...
const string & getSplit() const
This class describes the interface of a strategy object for the Slice Algorithm.
virtual void setUseSimplification(bool use)=0
This method should only be called before calling run().
virtual void setUseIndependence(bool use)=0
This method should only be called before calling run().
virtual void run(const Ideal &ideal)=0
Run the Slice algorithm.
static auto_ptr< SplitStrategy > createStrategy(const string &prefix)
Returns the strategy whose name has the given prefix.
A wrapper for a SliceStrategy that collects statistics on what is going on, while delegating everythi...
This class is used to transfer terms one at a time from one part of the program to another,...
virtual void consumeRing(const VarNames &names)
Tell the consumer which ring is being used.
A TermGrader assigns a value, the degree, to each monomial.
const mpz_class & getExponent(size_t variable, Exponent exponent) const
This method translates from IDs to arbitrary precision integers.
void addPurePowersAtInfinity(Ideal &ideal) const
Adds a generator of the form v^e, e > 0, for any variable v where generator of that form is not alrea...
void dualize(const vector< mpz_class > &a)
Replaces var^v by var^(a[i] - v) except that var^0 is left alone.
void setInfinityPowersToZero(Ideal &ideal) const
The method addPurePowersAtInfinity adds high exponents that map to zero.
void decrement()
Replaces var^v by var^(v-1).
Term represents a product of variables which does not include a coefficient.
static bool hasSameSupport(const Exponent *a, const Exponent *b, size_t varCount)
Returns whether for every variable .
static void encodedDual(Exponent *res, const Exponent *dualOf, const Exponent *point, size_t varCount)
The parameter dualOf is interpreted to encode an irreducible ideal, and the dual of that reflected in...
void displayNote(const string &msg)
Display msg to standard error in a way that indicates that this is something that the user should tak...
This file contains functions for printing strings to standard error.
void reportError(const string &errorMsg)
void codimension(const Ideal &ideal, mpz_t codim)
Compute the codimension of a monomial ideal.
void lcm(Word *res, const Word *resEnd, const Word *a, const Word *b)