Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

GAP 4.8.9 installation with standard packages -- copy to your CoCalc project to get it

563619 views
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_HELPER_H_
25
#define CONE_HELPER_H_
26
27
#include <vector>
28
#include <list>
29
#include <boost/dynamic_bitset.hpp>
30
31
#include "libnormaliz/general.h"
32
#include "libnormaliz/matrix.h"
33
34
namespace libnormaliz {
35
using std::vector;
36
37
// determines the maximal subsets in a vector of subsets given by their indicator vectors
38
// result returned in is_max_subset -- must be initialized outside
39
// only set to false in this routine
40
// if a set occurs more than once, only the last instance is recognized as maximal
41
void maximal_subsets(const vector<vector<bool> >& ind, vector<bool>& is_max_subset);
42
43
// the project-and-lift algorithm for lattice points in a polytope
44
45
template<typename IntegerPL, typename IntegerRet>
46
class ProjectAndLift {
47
48
template<typename,typename> friend class ProjectAndLift;
49
50
vector<Matrix<IntegerPL> > AllSupps;
51
vector<vector<size_t> > AllOrders;
52
53
vector<boost::dynamic_bitset<> > StartInd;
54
vector<boost::dynamic_bitset<> > StartPair;
55
vector<boost::dynamic_bitset<> > StartParaInPair;
56
57
size_t StartRank;
58
59
list<vector<IntegerRet> > Deg1Points;
60
vector<IntegerRet> SingleDeg1Point;
61
vector<IntegerRet> excluded_point;
62
IntegerRet GD;
63
64
size_t EmbDim;
65
bool verbose;
66
67
bool is_parallelotope;
68
bool no_crunch; // indicates that the projection vector is nevere parallel to a facet of
69
// the parallelotope (in all dimensions)
70
71
vector<size_t> order_supps(const Matrix<IntegerPL>& Supps);
72
bool fiber_interval(IntegerRet& MinInterval, IntegerRet& MaxInterval,
73
const vector<IntegerRet>& base_point);
74
75
void lift_point_recursively(vector<IntegerRet>& final_latt_point,
76
const vector<IntegerRet>& latt_point_proj);
77
void lift_points_to_this_dim(list<vector<IntegerRet> >& Deg1Points, const list<vector<IntegerRet> >& Deg1Proj);
78
79
void find_single_point();
80
void lift_points_by_generation();
81
82
void compute_projections(size_t dim, vector< boost::dynamic_bitset<> >& Ind,
83
vector< boost::dynamic_bitset<> >& Pair,
84
vector< boost::dynamic_bitset<> >& ParaInPair,size_t rank);
85
86
void initialize(const Matrix<IntegerPL>& Supps,size_t rank);
87
88
public:
89
90
ProjectAndLift();
91
ProjectAndLift(const Matrix<IntegerPL>& Supps,const vector<boost::dynamic_bitset<> >& Ind,size_t rank);
92
ProjectAndLift(const Matrix<IntegerPL>& Supps,const vector<boost::dynamic_bitset<> >& Pair,
93
const vector<boost::dynamic_bitset<> >& ParaInPair,size_t rank);
94
95
void set_excluded_point(const vector<IntegerRet>& excl_point);
96
void set_grading_denom(const IntegerRet GradingDenom);
97
void set_verbose(bool on_off);
98
99
void compute(bool do_all_points=true);
100
void put_eg1Points_into(Matrix<IntegerRet>& LattPoints);
101
void put_single_point_into(vector<IntegerRet>& LattPoint);
102
};
103
104
/* template<typename IntegerPL, typename IntegerRet>
105
void project_and_lift_inner(Matrix<IntegerRet>& Deg1, const Matrix<IntegerPL>& Supps,
106
vector<boost::dynamic_bitset<> >& Ind, const IntegerRet& GD, size_t rank,
107
bool verbose, bool all_points, const vector<IntegerRet>& excluded_point);
108
*/
109
110
// computes c1*v1-c2*v2
111
template<typename Integer>
112
vector<Integer> FM_comb(Integer c1, const vector<Integer>& v1,Integer c2, const vector<Integer>& v2, bool& is_zero);
113
114
} //end namespace libnormaliz
115
116
#endif /* CONE_HELPER_H_ */
117
118