GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it
/*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_HELPER_H_24#define CONE_HELPER_H_2526#include <vector>27#include <list>28#include <boost/dynamic_bitset.hpp>2930#include "libnormaliz/general.h"31#include "libnormaliz/matrix.h"3233namespace libnormaliz {34using std::vector;3536// determines the maximal subsets in a vector of subsets given by their indicator vectors37// result returned in is_max_subset -- must be initialized outside38// only set to false in this routine39// if a set occurs more than once, only the last instance is recognized as maximal40void maximal_subsets(const vector<vector<bool> >& ind, vector<bool>& is_max_subset);4142// the project-and-lift algorithm for lattice points in a polytope4344template<typename IntegerPL, typename IntegerRet>45class ProjectAndLift {4647template<typename,typename> friend class ProjectAndLift;4849vector<Matrix<IntegerPL> > AllSupps;50vector<vector<size_t> > AllOrders;5152vector<boost::dynamic_bitset<> > StartInd;53vector<boost::dynamic_bitset<> > StartPair;54vector<boost::dynamic_bitset<> > StartParaInPair;5556size_t StartRank;5758list<vector<IntegerRet> > Deg1Points;59vector<IntegerRet> SingleDeg1Point;60vector<IntegerRet> excluded_point;61IntegerRet GD;6263size_t EmbDim;64bool verbose;6566bool is_parallelotope;67bool no_crunch; // indicates that the projection vector is nevere parallel to a facet of68// the parallelotope (in all dimensions)6970vector<size_t> order_supps(const Matrix<IntegerPL>& Supps);71bool fiber_interval(IntegerRet& MinInterval, IntegerRet& MaxInterval,72const vector<IntegerRet>& base_point);7374void lift_point_recursively(vector<IntegerRet>& final_latt_point,75const vector<IntegerRet>& latt_point_proj);76void lift_points_to_this_dim(list<vector<IntegerRet> >& Deg1Points, const list<vector<IntegerRet> >& Deg1Proj);7778void find_single_point();79void lift_points_by_generation();8081void compute_projections(size_t dim, vector< boost::dynamic_bitset<> >& Ind,82vector< boost::dynamic_bitset<> >& Pair,83vector< boost::dynamic_bitset<> >& ParaInPair,size_t rank);8485void initialize(const Matrix<IntegerPL>& Supps,size_t rank);8687public:8889ProjectAndLift();90ProjectAndLift(const Matrix<IntegerPL>& Supps,const vector<boost::dynamic_bitset<> >& Ind,size_t rank);91ProjectAndLift(const Matrix<IntegerPL>& Supps,const vector<boost::dynamic_bitset<> >& Pair,92const vector<boost::dynamic_bitset<> >& ParaInPair,size_t rank);9394void set_excluded_point(const vector<IntegerRet>& excl_point);95void set_grading_denom(const IntegerRet GradingDenom);96void set_verbose(bool on_off);9798void compute(bool do_all_points=true);99void put_eg1Points_into(Matrix<IntegerRet>& LattPoints);100void put_single_point_into(vector<IntegerRet>& LattPoint);101};102103/* template<typename IntegerPL, typename IntegerRet>104void project_and_lift_inner(Matrix<IntegerRet>& Deg1, const Matrix<IntegerPL>& Supps,105vector<boost::dynamic_bitset<> >& Ind, const IntegerRet& GD, size_t rank,106bool verbose, bool all_points, const vector<IntegerRet>& excluded_point);107*/108109// computes c1*v1-c2*v2110template<typename Integer>111vector<Integer> FM_comb(Integer c1, const vector<Integer>& v1,Integer c2, const vector<Integer>& v2, bool& is_zero);112113} //end namespace libnormaliz114115#endif /* CONE_HELPER_H_ */116117118