1 /* Frobby: Software for monomial ideal computations.
2    Copyright (C) 2009 University of Aarhus
3    Contact Bjarke Hammersholt Roune for license information (www.broune.com)
4 
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9 
10    This program is distributed in the hope that it will be useful,
11    but WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13    GNU General Public License for more details.
14 
15    You should have received a copy of the GNU General Public License
16    along with this program.  If not, see http://www.gnu.org/licenses/.
17 */
18 #ifndef COMMON_PARAMS_GUARD
19 #define COMMON_PARAMS_GUARD
20 
21 #include <string>
22 
23 class CliParams;
24 
25 class CommonParams {
26  public:
27   CommonParams();
28 
29   /** Returns whether the input ideal is known to be minimally
30       generated. This option is off by default.
31 
32       If the ideal is minimally generated, setting this option can
33       improve performance. However, if this option is set and the ideal
34       is not actually minimally generated, then Frobby will exhibit
35       undefined behavior. Possibilities for what might happen include
36       crashing, going into an infinite loop and producing incorrect
37       results. */
getIdealIsMinimal()38   bool getIdealIsMinimal() const {return _idealIsMinimal;}
idealIsMinimal(bool value)39   void idealIsMinimal(bool value) {_idealIsMinimal = value;}
40 
41   /** Returns whether to print and time the large-scale actions
42       that Frobby performs. */
getPrintActions()43   bool getPrintActions() const {return _printActions;}
printActions(bool value)44   void printActions(bool value) {_printActions = value;}
45 
46   /** Returns the format used for parsing input. */
getInputFormat()47   const string& getInputFormat() const {return _inputFormat;}
setInputFormat(const string & value)48   void setInputFormat(const string& value) {_inputFormat = value;}
49 
50   /** Returns the format in which output is produced. */
getOutputFormat()51   const string& getOutputFormat() const {return _outputFormat;}
setOutputFormat(const string & value)52   void setOutputFormat(const string& value) {_outputFormat = value;}
53 
54   /** Returns whether to produce output in a canonical
55       representation. */
getProduceCanonicalOutput()56   bool getProduceCanonicalOutput() const {return _produceCanonicalOutput;}
produceCanonicalOutput(bool value)57   void produceCanonicalOutput(bool value) {_produceCanonicalOutput = value;}
58 
59   /** Returns whether to print information about what the algorithm
60       is doing to standard error as it runs. */
getPrintDebug()61   bool getPrintDebug() const {return _printDebug;}
printDebug(bool value)62   void printDebug(bool value) {_printDebug = value;}
63 
64   /** Returns whether to print statistics on what the algorithm did
65       to standard error after it has run. */
getPrintStatistics()66   bool getPrintStatistics() const {return _printStatistics;}
printStatistics(bool value)67   void printStatistics(bool value) {_printStatistics = value;}
68 
69  private:
70   bool _idealIsMinimal;
71   bool _printActions;
72   bool _produceCanonicalOutput;
73   bool _printDebug;
74   bool _printStatistics;
75 
76   string _inputFormat;
77   string _outputFormat;
78 };
79 
80 void addCommonParams(CliParams& params);
81 void addDebugParam(CliParams& params);
82 
83 void extractCliValues(CommonParams& common, const CliParams& cli);
84 
85 #endif
86