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: 418427
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
#ifndef CONE_PROPERTY_H_
25
#define CONE_PROPERTY_H_
26
27
#include <bitset>
28
#include <ostream>
29
30
namespace libQnormaliz {
31
32
/* An enumeration of things, that can be computed for a cone.
33
* The namespace prevents interfering with other names.
34
* Remember to change also the string conversion if you change this enum!
35
*/
36
namespace ConeProperty {
37
enum Enum {
38
//
39
// goals that can be computed (or are defined by input data)
40
//
41
// matrix valued
42
Generators,
43
ExtremeRays,
44
VerticesOfPolyhedron,
45
SupportHyperplanes,
46
HilbertBasis,
47
ModuleGenerators,
48
Deg1Elements,
49
ModuleGeneratorsOverOriginalMonoid,
50
Sublattice,
51
ExcludedFaces,
52
OriginalMonoidGenerators,
53
MaximalSubspace,
54
Equations, // new
55
Congruences, // new
56
//vector valued
57
Grading,
58
Dehomogenization,
59
WitnessNotIntegrallyClosed,
60
// Cardinalities
61
TriangulationSize,
62
// Number valued,
63
TriangulationDetSum,
64
ReesPrimaryMultiplicity,
65
GradingDenom, // new
66
UnitGroupIndex, // new
67
InternalIndex, // new
68
ExternalIndex, // new
69
// rational valued
70
Multiplicity,
71
// dimensions
72
RecessionRank,
73
AffineDim,
74
ModuleRank,
75
Rank, // new
76
EmbeddingDim, // new
77
// boolean valued
78
IsPointed,
79
IsDeg1ExtremeRays,
80
IsDeg1HilbertBasis,
81
IsIntegrallyClosed,
82
IsReesPrimary,
83
IsInhomogeneous, // new
84
// complex structures
85
Triangulation,
86
HilbertSeries,
87
InclusionExclusionData,
88
StanleyDec,
89
ClassGroup,
90
NumberHull,
91
ConeDecomposition,
92
HilbertQuasiPolynomial,
93
//
94
// integer type for computations
95
//
96
BigInt,
97
//
98
// algorithmic variants
99
//
100
DefaultMode,
101
Approximate,
102
BottomDecomposition,
103
NoBottomDec,
104
DualMode,
105
PrimalMode, //new
106
Symmetrize, // new
107
NoSymmetrization, // new
108
KeepOrder,
109
HSOP,
110
//
111
// checking properties of already computed data
112
// (cannot be used as a computation goal)
113
//
114
IsTriangulationNested, //new
115
IsTriangulationPartial, //new
116
117
EnumSize // this has to be the last entry, to get the number of entries in the enum
118
}; // remember to change also the string conversion function if you change this enum
119
}
120
121
class ConeProperties {
122
public:
123
/* Constructors */
124
ConeProperties();
125
ConeProperties(ConeProperty::Enum);
126
ConeProperties(ConeProperty::Enum, ConeProperty::Enum);
127
ConeProperties(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);
128
ConeProperties(const std::bitset<ConeProperty::EnumSize>&);
129
130
/* set properties */
131
ConeProperties& set(ConeProperty::Enum, bool value=true);
132
ConeProperties& set(const std::string s, bool value=true);
133
ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum);
134
ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);
135
ConeProperties& set(const ConeProperties&);
136
137
/* reset (=unset) properties */
138
ConeProperties& reset(ConeProperty::Enum Property);
139
ConeProperties& reset(const ConeProperties&);
140
ConeProperties& reset_compute_options();
141
142
/* test which/how many properties are set */
143
bool test(ConeProperty::Enum Property) const;
144
bool any() const;
145
bool none() const;
146
size_t count () const;
147
148
/* return the restriction of this to the goals / options */
149
ConeProperties goals();
150
ConeProperties options();
151
152
/* the following methods are used internally */
153
void set_preconditions(); // activate properties which are needed implicitly
154
void prepare_compute_options(bool inhomogeneous);
155
void check_sanity(bool inhomogeneous);
156
void check_Q_permissible();
157
158
/* print it in a nice way */
159
friend std::ostream& operator<<(std::ostream&, const ConeProperties&);
160
161
162
private:
163
std::bitset<ConeProperty::EnumSize> CPs;
164
165
};
166
167
// conversion to/from strings
168
bool isConeProperty(ConeProperty::Enum& cp, const std::string& s);
169
ConeProperty::Enum toConeProperty(const std::string&);
170
const std::string& toString(ConeProperty::Enum);
171
std::ostream& operator<<(std::ostream&, const ConeProperties&);
172
173
}
174
175
#endif /* CONE_PROPERTY_H_ */
176
177