Frobby 0.9.5
ScarfParams.cpp
Go to the documentation of this file.
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2010 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#include "stdinc.h"
19#include "ScarfParams.h"
20
21#include "CliParams.h"
22#include "StringParameter.h"
23#include "BoolParameter.h"
24
25namespace {
26 static const char* DeformToStrongName = "deformStrong";
27 static const bool DeformToStrongDefault = false;
28
29 static const char* EnumerationOrderName = "enum";
30 static const char* EnumerationOrderDefault = "revlex";
31
32 static const char* DeformationOrderName = "deformationOrder";
33 static const char* DeformationOrderDefault = "tdeg_lex";
34}
35
37 _deformStrong(DeformToStrongDefault),
38 _enumerationOrder(EnumerationOrderDefault),
39 _deformationOrder(DeformationOrderDefault) {
40 extractCliValues(*this, cli);
41}
42
44 ASSERT(!params.hasParam(DeformToStrongName));
45 params.add
46 (auto_ptr<Parameter>
47 (new BoolParameter
48 (DeformToStrongName,
49 "Deform to a strongly generic ideal if true. "
50 "Otherwise deform to a weakly generic ideal.",
51 DeformToStrongDefault)));
52
53 ASSERT(!params.hasParam(EnumerationOrderName));
54 params.add
55 (auto_ptr<Parameter>
57 (EnumerationOrderName,
58 "The enumeration order used for the deformation algorithm.",
59 EnumerationOrderDefault)));
60
61 ASSERT(!params.hasParam(DeformationOrderName));
62 params.add
63 (auto_ptr<Parameter>
65 (DeformationOrderName,
66 "The deformation order used for the deformation algorithm.",
67 DeformationOrderDefault)));
68}
69
70void extractCliValues(ScarfParams& scarf, const CliParams& cli) {
71 extractCliValues(static_cast<CommonParams&>(scarf), cli);
72 scarf.setDeformToStronglyGeneric(getBool(cli, DeformToStrongName));
73 scarf.setEnumerationOrder(getString(cli, EnumerationOrderName));
74 scarf.setDeformationOrder(getString(cli, DeformationOrderName));
75}
const string & getString(const CliParams &params, const string &name)
bool getBool(const CliParams &params, const string &name)
void addScarfParams(CliParams &params)
void extractCliValues(ScarfParams &scarf, const CliParams &cli)
void extractCliValues(ScarfParams &scarf, const CliParams &cli)
bool hasParam(const string &name) const
void add(auto_ptr< Parameter > param)
Definition CliParams.cpp:88
void setDeformToStronglyGeneric(bool value)
Definition ScarfParams.h:34
ScarfParams(CliParams &cli)
void setEnumerationOrder(const string &name)
Definition ScarfParams.h:38
void setDeformationOrder(const string &name)
Definition ScarfParams.h:42
This header file includes common definitions and is included as the first line of code in every imple...
#define ASSERT(X)
Definition stdinc.h:86