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: 418346
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 "libnormaliz/libnormaliz.h"
31
#include "libnormaliz/cone.h"
32
using namespace libnormaliz;
33
34
//#include "Input.h"
35
#include "output.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 Integer>
54
void applyOutputOptions(Output<Integer>& Out);
55
56
bool isFilenameSet() const {
57
return project_name_set;
58
}
59
60
bool isIgnoreInFileOpt() const {
61
return ignoreInFileOpt;
62
}
63
64
int getNrThreads() const {
65
return nr_threads;
66
}
67
68
void activateConeProperty(ConeProperty::Enum cp) {
69
to_compute.set(cp, true);
70
}
71
72
void activateInputFileConeProperty(ConeProperty::Enum cp) {
73
if (!ignoreInFileOpt) to_compute.set(cp, true);
74
}
75
/* void activateInputFileBigInt() {
76
if (!ignoreInFileOpt) use_Big_Integer = true;
77
}*/
78
void activateInputFileLongLong() {
79
if (!ignoreInFileOpt) use_long_long = true;
80
}
81
82
void activateNoExtRaysOutput() {
83
if (!ignoreInFileOpt) no_ext_rays_output = true;
84
}
85
86
const ConeProperties& getToCompute() const {
87
return to_compute;
88
}
89
90
/* bool isUseBigInteger() const {
91
return use_Big_Integer;
92
}*/
93
bool isUseLongLong() const {
94
return use_long_long;
95
}
96
97
bool isNoExtRaysOutput() const {
98
return no_ext_rays_output;
99
}
100
101
const string& getProjectName() const {
102
return project_name;
103
}
104
105
const string& getOutputDir() const {
106
return output_dir;
107
}
108
109
void setProjectName(const string& s);
110
void setOutputDirName(const string& s);
111
112
//---------------------------------------------------------------------------
113
114
private:
115
bool project_name_set;
116
bool output_dir_set;
117
string project_name;
118
string output_dir;
119
string output_file;
120
121
// bool use_Big_Integer; now in ConeProperty
122
bool use_long_long;
123
bool no_ext_rays_output;
124
125
bool ignoreInFileOpt;
126
127
int nr_threads;
128
129
ConeProperties to_compute;
130
131
bool write_extra_files, write_all_files;
132
133
vector<string> OutFiles;
134
135
//return true if help should be printed, false otherwise
136
bool handle_options(vector<string>& LongOptions, string& ShortOptions);
137
};
138
139
//---------------------------------------------------------------------------
140
141
string pureName(const string& fullName); // extracts the pure filename from a path
142
143
#endif //NMZ_OPTIONS_H
144
145