Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
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
Project: cocalc-sagemath-dev-slelievre
Path: gap4r8 / pkg / NormalizInterface-1.0.2 / Normaliz.git / DST / include / libQnormaliz / Qcone_property.h
Views: 418427/*1* Normaliz2* Copyright (C) 2007-2014 Winfried Bruns, Bogdan Ichim, Christof Soeger3* This program is free software: you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation, either version 3 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program. If not, see <http://www.gnu.org/licenses/>.15*16* As an exception, when this program is distributed through (i) the App Store17* by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or (iii) Google Play18* by Google Inc., then that store may impose any digital rights management,19* device limits and/or redistribution restrictions that are required by its20* terms of service.21*/2223#ifndef CONE_PROPERTY_H_24#define CONE_PROPERTY_H_2526#include <bitset>27#include <ostream>2829namespace libQnormaliz {3031/* An enumeration of things, that can be computed for a cone.32* The namespace prevents interfering with other names.33* Remember to change also the string conversion if you change this enum!34*/35namespace ConeProperty {36enum Enum {37//38// goals that can be computed (or are defined by input data)39//40// matrix valued41Generators,42ExtremeRays,43VerticesOfPolyhedron,44SupportHyperplanes,45HilbertBasis,46ModuleGenerators,47Deg1Elements,48ModuleGeneratorsOverOriginalMonoid,49Sublattice,50ExcludedFaces,51OriginalMonoidGenerators,52MaximalSubspace,53Equations, // new54Congruences, // new55//vector valued56Grading,57Dehomogenization,58WitnessNotIntegrallyClosed,59// Cardinalities60TriangulationSize,61// Number valued,62TriangulationDetSum,63ReesPrimaryMultiplicity,64GradingDenom, // new65UnitGroupIndex, // new66InternalIndex, // new67ExternalIndex, // new68// rational valued69Multiplicity,70// dimensions71RecessionRank,72AffineDim,73ModuleRank,74Rank, // new75EmbeddingDim, // new76// boolean valued77IsPointed,78IsDeg1ExtremeRays,79IsDeg1HilbertBasis,80IsIntegrallyClosed,81IsReesPrimary,82IsInhomogeneous, // new83// complex structures84Triangulation,85HilbertSeries,86InclusionExclusionData,87StanleyDec,88ClassGroup,89NumberHull,90ConeDecomposition,91HilbertQuasiPolynomial,92//93// integer type for computations94//95BigInt,96//97// algorithmic variants98//99DefaultMode,100Approximate,101BottomDecomposition,102NoBottomDec,103DualMode,104PrimalMode, //new105Symmetrize, // new106NoSymmetrization, // new107KeepOrder,108HSOP,109//110// checking properties of already computed data111// (cannot be used as a computation goal)112//113IsTriangulationNested, //new114IsTriangulationPartial, //new115116EnumSize // this has to be the last entry, to get the number of entries in the enum117}; // remember to change also the string conversion function if you change this enum118}119120class ConeProperties {121public:122/* Constructors */123ConeProperties();124ConeProperties(ConeProperty::Enum);125ConeProperties(ConeProperty::Enum, ConeProperty::Enum);126ConeProperties(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);127ConeProperties(const std::bitset<ConeProperty::EnumSize>&);128129/* set properties */130ConeProperties& set(ConeProperty::Enum, bool value=true);131ConeProperties& set(const std::string s, bool value=true);132ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum);133ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);134ConeProperties& set(const ConeProperties&);135136/* reset (=unset) properties */137ConeProperties& reset(ConeProperty::Enum Property);138ConeProperties& reset(const ConeProperties&);139ConeProperties& reset_compute_options();140141/* test which/how many properties are set */142bool test(ConeProperty::Enum Property) const;143bool any() const;144bool none() const;145size_t count () const;146147/* return the restriction of this to the goals / options */148ConeProperties goals();149ConeProperties options();150151/* the following methods are used internally */152void set_preconditions(); // activate properties which are needed implicitly153void prepare_compute_options(bool inhomogeneous);154void check_sanity(bool inhomogeneous);155void check_Q_permissible();156157/* print it in a nice way */158friend std::ostream& operator<<(std::ostream&, const ConeProperties&);159160161private:162std::bitset<ConeProperty::EnumSize> CPs;163164};165166// conversion to/from strings167bool isConeProperty(ConeProperty::Enum& cp, const std::string& s);168ConeProperty::Enum toConeProperty(const std::string&);169const std::string& toString(ConeProperty::Enum);170std::ostream& operator<<(std::ostream&, const ConeProperties&);171172}173174#endif /* CONE_PROPERTY_H_ */175176177