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
45 params.add
47 (new BoolParameter
49 "Deform to a strongly generic ideal if true. "
50 "Otherwise deform to a weakly generic ideal.",
52
54 params.add
58 "The enumeration order used for the deformation algorithm.",
60
62 params.add
66 "The deformation order used for the deformation algorithm.",
68}
69
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 nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
void addScarfParams(CliParams &params)
void extractCliValues(ScarfParams &scarf, const CliParams &cli)
void extractCliValues(ScarfParams &scarf, const CliParams &cli)
ScarfParams(CliParams &cli)
#define ASSERT(X)
Definition stdinc.h:86