Frobby 0.9.5
GenerateFrobeniusAction.cpp
Go to the documentation of this file.
1/* Frobby: Software for monomial ideal computations.
2 Copyright (C) 2007 Bjarke Hammersholt Roune (www.broune.com)
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see http://www.gnu.org/licenses/.
16*/
17#include "stdinc.h"
19
20#include "BigIdeal.h"
21#include "GenerateDataFacade.h"
22#include "IOFacade.h"
23#include "error.h"
24
26 Action
27(staticGetName(),
28 "Generate a random Frobenius problem instance.",
29 "Generate a random Frobenius problem instance.",
30 false),
31
32 _entryCount
33 ("entryCount",
34 "The number of entries in the random instance.",
35 4),
36
37 _maxEntryDigits
38 ("maxEntryDigits",
39 "The largest allowed number of decimal digits for entries in the\n"
40 "random instance.",
41 2) {
42}
43
50
52 vector<mpz_class> instance;
53
54 if (_entryCount < 1)
55 reportError("There must be at least one entry.");
56 if (_maxEntryDigits < 1)
57 reportError("The largest allowed number of digits must be at least 1.");
58
61
63 generator.generateFrobeniusInstance
65
67 ioFacade.writeFrobeniusInstance(stdout, instance);
68}
69
71 return "genfrob";
72}
void nameFactoryRegister(NameFactory< AbstractProduct > &factory)
Registers the string returned by ConcreteProduct::getStaticName() to a function that default-construc...
BoolParameter _printActions
Definition Action.h:68
virtual void obtainParameters(vector< Parameter * > &parameters)
Definition Action.cpp:133
A facade for random and other kinds of data.
static const char * staticGetName()
virtual void obtainParameters(vector< Parameter * > &parameters)
A facade for input and output of mathematical objects.
Definition IOFacade.h:39
unsigned int getValue() const
void reportError(const string &errorMsg)
Definition error.cpp:23