36 "Solve optimization problems related to the input ideal.",
37 "Solves an optimization program defined by the input monomial ideal I, and " 38 "an\ninput vector of integers v. The optimization program is \n" 40 " maximize v * e such that e encodes an irreducible component of I,\n" 42 "where * is dot product and e is a vector of integers that uniquely encodes " 43 "an\nirreducible ideal by being the exponent vector of the product of the\n" 44 "minimal generators.\n" 46 "The input is composed of the ideal I in any format, optionally followed by " 47 "the\nentries of v in a space separated list. If v is not explicitly " 48 "specified,\nthen every entry is assumed to 1, i.e. then v is of the form " 51 "This action has options for displaying the optimal value or not and for\n" 52 "displaying zero, one or all of the optimal solutions. The algorithm used " 53 "to\nsolve the optimization program is the Slice Algorithm using the bound\n" 54 "optimization. Thus this action also has options related to that.",
57 _sliceParams(true, false),
61 "Controls how many optimal solutions to display. If the value is 0 or " 62 "1,\nFrobby displays 0 or 1 solutions respectively. If the value is 2 or " 63 "more,\nall solutions are displayed. The output is presented as generators " 64 "of a\nmonomial ideal.",
69 "Display the optimal value of the optimization program.",
74 "Solve the optimization program for maximal standard monomials instead " 75 "of\nfor monomials representing irreducible components.",
79 (
"chopFirstAndSubtract",
80 "Remove the first variable from generators, from the ring and from v, " 81 "and\nsubtract the value of the first entry of v from the reported " 82 "optimal value.\nThis is useful for Frobenius number calculations.",
87 "Minimize the value of v * e above. If this option is not set, maximize " 88 "v * e\ninstead, as is the stated default above.",
126 mpz_class subtract = 0;
139 for (
size_t var = 0; var < v.size(); ++var)
143 auto_ptr<IOHandler> handler;
144 auto_ptr<BigTermConsumer> output;
147 output = handler->createIdealWriter(stdout);
153 mpz_class optimalValue = 0;
159 (v, optimalValue, displayAll);
162 (v, optimalValue, displayAll);
166 fputs(
"no solution.\n", stdout);
171 optimalValue = -optimalValue;
174 optimalValue -= subtract;
175 gmp_fprintf(stdout,
"%Zd\n", optimalValue.get_mpz_t());
IntegerParameter _displayLevel
void readIdeal(Scanner &in, BigTermConsumer &consumer)
Read an ideal from in and feed it to consumer.
void validateFormats() const
BoolParameter _chopFirstAndSubtract
SliceParameters _sliceParams
virtual void obtainParameters(vector< Parameter *> ¶meters)
BoolParameter _printActions
virtual void obtainParameters(vector< Parameter *> ¶meters)
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
void autoDetectInputFormat(Scanner &in)
If using the input format, this must be called before validating the ideals, since the auto detect fo...
static const char * staticGetName()
size_t getVarCount() const
void eraseVar(size_t var)
bool solveStandardProgram(const vector< mpz_class > &grading, mpz_class &value, bool reportAllSolutions)
Solve an optimization program over maximal standard monomials.
This class offers an input interface which is more convenient and for some purposes more efficient th...
A facade for operations on monomial ideals using the Slice Algorithm.
void setSplit(const string &split)
Set the value of the option for choosing the split selection strategy.
auto_ptr< IOHandler > createOutputHandler() const
BoolParameter _minimizeValue
const string & getInputFormat() const
A facade for input and output of mathematical objects.
void obtainParameters(vector< Parameter *> ¶meters)
BoolParameter _displayValue
This follows the null object pattern.
bool solveIrreducibleDecompositionProgram(const vector< mpz_class > &grading, mpz_class &optimalValue, bool reportAllSolutions)
Solve an optimization program over irreducible components.
void validateSplit(const SliceParams ¶ms, bool allowLabel, bool allowDegree)
void readVector(Scanner &in, vector< mpz_class > &v, size_t integerCount)
BoolParameter _maxStandard