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());
void validateSplit(const SliceParams ¶ms, bool allowLabel, bool allowDegree)
BoolParameter _printActions
virtual void obtainParameters(vector< Parameter * > ¶meters)
void eraseVar(size_t var)
size_t getVarCount() const
The intention of this class is to describe the different kinds of mathematical structures that Frobby...
A facade for input and output of mathematical objects.
void readIdeal(Scanner &in, BigTermConsumer &consumer)
Read an ideal from in and feed it to consumer.
void readVector(Scanner &in, vector< mpz_class > &v, size_t integerCount)
void autoDetectInputFormat(Scanner &in)
If using the input format, this must be called before validating the ideals, since the auto detect fo...
auto_ptr< IOHandler > createOutputHandler() const
const string & getInputFormat() const
void validateFormats() const
This follows the null object pattern.
IntegerParameter _displayLevel
SliceParameters _sliceParams
BoolParameter _minimizeValue
BoolParameter _chopFirstAndSubtract
static const char * staticGetName()
virtual void obtainParameters(vector< Parameter * > ¶meters)
BoolParameter _maxStandard
BoolParameter _displayValue
void obtainParameters(vector< Parameter * > ¶meters)
This class offers an input interface which is more convenient and for some purposes more efficient th...
void expectEOF()
Require that there is no more input.
bool matchEOF()
Return true if no more input.
A facade for operations on monomial ideals using the Slice Algorithm.
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.
void setSplit(const string &split)
Set the value of the option for choosing the split selection strategy.