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 / libnormaliz / cone_property.h
Views: 418425/*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 libnormaliz {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,43VerticesFloat,44VerticesOfPolyhedron,45SupportHyperplanes,46HilbertBasis,47ModuleGenerators,48Deg1Elements,49ModuleGeneratorsOverOriginalMonoid,50Sublattice,51ExcludedFaces,52OriginalMonoidGenerators,53MaximalSubspace,54Equations,55Congruences,56//vector valued57Grading,58Dehomogenization,59WitnessNotIntegrallyClosed,60GeneratorOfInterior,61// Cardinalities62TriangulationSize,63// Integer valued,64TriangulationDetSum,65ReesPrimaryMultiplicity,66GradingDenom,67UnitGroupIndex,68InternalIndex,69ExternalIndex,70// rational valued71Multiplicity,72Integral,73VirtualMultiplicity,74// dimensions75RecessionRank,76AffineDim,77ModuleRank,78Rank,79EmbeddingDim,80// boolean valued81IsPointed,82IsDeg1ExtremeRays,83IsDeg1HilbertBasis,84IsIntegrallyClosed,85IsReesPrimary,86IsInhomogeneous,87IsGorenstein,88// complex structures89Triangulation,90StanleyDec,91InclusionExclusionData,92ClassGroup,93IntegerHull,94ConeDecomposition,95HilbertSeries,96HilbertQuasiPolynomial,97WeightedEhrhartSeries,98WeightedEhrhartQuasiPolynomial,99//100// integer type for computations101//102BigInt,103//104// algorithmic variants105//106DefaultMode,107Approximate,108BottomDecomposition,109NoBottomDec,110DualMode,111PrimalMode,112Projection,113ProjectionFloat,114NoProjection,115Symmetrize,116NoSymmetrization,117NoSubdivision,118NoNestedTri, // synonym for NoSubdivision119KeepOrder,120HSOP,121NoPeriodBound,122SCIP,123//124// checking properties of already computed data125// (cannot be used as a computation goal)126//127IsTriangulationNested,128IsTriangulationPartial,129130EnumSize // this has to be the last entry, to get the number of entries in the enum131}; // remember to change also the string conversion function if you change this enum132}133134class ConeProperties {135public:136/* Constructors */137ConeProperties();138ConeProperties(ConeProperty::Enum);139ConeProperties(ConeProperty::Enum, ConeProperty::Enum);140ConeProperties(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);141ConeProperties(const std::bitset<ConeProperty::EnumSize>&);142143/* set properties */144ConeProperties& set(ConeProperty::Enum, bool value=true);145ConeProperties& set(const std::string s, bool value=true);146ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum);147ConeProperties& set(ConeProperty::Enum, ConeProperty::Enum, ConeProperty::Enum);148ConeProperties& set(const ConeProperties&);149150/* reset (=unset) properties */151ConeProperties& reset(ConeProperty::Enum Property);152ConeProperties& reset(const ConeProperties&);153ConeProperties& reset_compute_options();154155/* test which/how many properties are set */156bool test(ConeProperty::Enum Property) const;157bool any() const;158bool none() const;159size_t count () const;160161/* return the restriction of this to the goals / options */162ConeProperties goals();163ConeProperties options();164165/* the following methods are used internally */166void set_preconditions(bool inhomogeneous); // activate properties which are needed implicitly167void prepare_compute_options(bool inhomogeneous);168void check_sanity(bool inhomogeneous);169void check_conflicting_variants();170171/* print it in a nice way */172friend std::ostream& operator<<(std::ostream&, const ConeProperties&);173174175private:176std::bitset<ConeProperty::EnumSize> CPs;177178};179180// conversion to/from strings181bool isConeProperty(ConeProperty::Enum& cp, const std::string& s);182ConeProperty::Enum toConeProperty(const std::string&);183const std::string& toString(ConeProperty::Enum);184std::ostream& operator<<(std::ostream&, const ConeProperties&);185186}187188#endif /* CONE_PROPERTY_H_ */189190191