CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

| Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

Views: 418385
1
/*
2
* Normaliz
3
* Copyright (C) 2007-2014 Winfried Bruns, Bogdan Ichim, Christof Soeger
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 3 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
* As an exception, when this program is distributed through (i) the App Store
18
* by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or (iii) Google Play
19
* by Google Inc., then that store may impose any digital rights management,
20
* device limits and/or redistribution restrictions that are required by its
21
* terms of service.
22
*/
23
24
#include <vector>
25
#include <list>
26
#include <string>
27
#include <sstream>
28
using namespace std;
29
30
#include "libQnormaliz/libQnormaliz.h"
31
#include "libQnormaliz/Qcone.h"
32
using namespace libQnormaliz;
33
34
//#include "Input.h"
35
#include "Qoutput.h"
36
37
#ifndef NMZ_OPTIONS_H
38
#define NMZ_OPTIONS_H
39
40
//---------------------------------------------------------------------------
41
42
class OptionsHandler {
43
44
public:
45
OptionsHandler();
46
47
// returns true if a help should be printed, false otherwise
48
bool handle_commandline(int argc, char* argv[]);
49
50
// returns true if default mode was activated, false otherwise
51
bool activateDefaultMode();
52
53
template<typename Number>
54
void applyOutputOptions(Output<Number>& Out);
55
56
// returns whether any nmzIntegrate option is set
57
bool anyNmzIntegrateOption() const;
58
59
string getNmzIntegrateOptions() const;
60
61
bool isFilenameSet() const {
62
return project_name_set;
63
}
64
65
bool isIgnoreInFileOpt() const {
66
return ignoreInFileOpt;
67
}
68
69
int getNrThreads() const {
70
return nr_threads;
71
}
72
73
void activateConeProperty(ConeProperty::Enum cp) {
74
to_compute.set(cp, true);
75
}
76
77
void activateInputFileConeProperty(ConeProperty::Enum cp) {
78
if (!ignoreInFileOpt) to_compute.set(cp, true);
79
}
80
/* void activateInputFileBigInt() {
81
if (!ignoreInFileOpt) use_Big_Number = true;
82
}*/
83
void activateInputFileLongLong() {
84
if (!ignoreInFileOpt) use_long_long = true;
85
}
86
87
const ConeProperties& getToCompute() const {
88
return to_compute;
89
}
90
91
/* bool isUseBigNumber() const {
92
return use_Big_Number;
93
}*/
94
bool isUseLongLong() const {
95
return use_long_long;
96
}
97
98
const string& getOutputName() const {
99
return project_name;
100
}
101
102
void setProjectName(const string& s);
103
void setOutputDirName(const string& s);
104
105
bool nr_threads_explicitly_set;
106
107
//---------------------------------------------------------------------------
108
109
private:
110
bool project_name_set;
111
bool output_dir_set;
112
string project_name;
113
string output_dir;
114
string output_file;
115
116
// bool use_Big_Number; now in ConeProperty
117
bool use_long_long;
118
bool ignoreInFileOpt;
119
bool nmzInt_E, nmzInt_I, nmzInt_L;
120
121
int nr_threads;
122
123
ConeProperties to_compute;
124
125
bool write_extra_files, write_all_files;
126
127
vector<string> OutFiles;
128
129
//return true if help should be printed, false otherwise
130
bool handle_options(vector<string>& LongOptions, string& ShortOptions);
131
};
132
133
//---------------------------------------------------------------------------
134
135
string pureName(const string& fullName); // extracts the pure filename from a path
136
137
#endif //NMZ_OPTIONS_H
138
139