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

563959 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_DUAL_MODE_H
25
#define CONE_DUAL_MODE_H
26
27
#include <list>
28
#include <vector>
29
30
#include "libnormaliz/libnormaliz.h"
31
#include "libnormaliz/matrix.h"
32
#include "libnormaliz/sublattice_representation.h"
33
#include "libnormaliz/reduction.h"
34
35
namespace libnormaliz {
36
using std::list;
37
using std::vector;
38
39
template<typename Integer> class CandidateList;
40
template<typename Integer> class Candidate;
41
42
template<typename Integer>
43
class Cone_Dual_Mode {
44
public:
45
size_t dim;
46
size_t nr_sh;
47
48
bool verbose;
49
50
bool inhomogeneous;
51
bool do_only_Deg1_Elements;
52
bool truncate; // = inhomogeneous || do_only_Deg1_Elements
53
54
Matrix<Integer> SupportHyperplanes;
55
Matrix<Integer> Generators;
56
vector<bool> ExtremeRaysInd;
57
list<Candidate<Integer>* > ExtremeRayList; //only temporarily used
58
CandidateList<Integer> Intermediate_HB; // intermediate Hilbert basis
59
list<vector<Integer> > Hilbert_Basis; //the final result
60
Matrix<Integer> BasisMaxSubspace; // a basis of the maximal linear subspace of the cone
61
62
/* ---------------------------------------------------------------------------
63
* Private routines, used in the public routines
64
* ---------------------------------------------------------------------------
65
*/
66
/* splices a vector of lists into a total list*/
67
void splice_them_sort(CandidateList< Integer>& Total, vector<CandidateList< Integer> >& Parts);
68
69
/* computes the Hilbert basis after adding a support hyperplane with the dual algorithm */
70
void cut_with_halfspace_hilbert_basis(const size_t & hyp_counter, const bool lifting,
71
vector<Integer> & halfspace, bool pointed);
72
73
/* computes the Hilbert basis after adding a support hyperplane with the dual algorithm , general case */
74
Matrix<Integer> cut_with_halfspace(const size_t & hyp_counter, const Matrix<Integer>& Basis_Max_Subspace);
75
76
/* computes the extreme rays using rank test */
77
void extreme_rays_rank();
78
79
void relevant_support_hyperplanes();
80
81
// move candidates of old_tot_deg <= guaranteed_HB_deg to Irred
82
void select_HB(CandidateList<Integer>& Cand, size_t guaranteed_HB_deg,
83
CandidateList<Integer>& Irred, bool all_irreducible);
84
85
Cone_Dual_Mode(Matrix<Integer>& M, const vector<Integer>& Truncation); //main constructor
86
87
/*---------------------------------------------------------------------------
88
* Data access
89
*---------------------------------------------------------------------------
90
*/
91
92
Matrix<Integer> get_support_hyperplanes() const;
93
Matrix<Integer> get_generators() const;
94
vector<bool> get_extreme_rays() const;
95
96
97
/*---------------------------------------------------------------------------
98
* Computation Methods
99
*---------------------------------------------------------------------------
100
*/
101
void hilbert_basis_dual();
102
103
/* transforms all data to the sublattice */
104
void to_sublattice(const Sublattice_Representation<Integer>& SR);
105
106
};
107
//class end *****************************************************************
108
109
}
110
111
//---------------------------------------------------------------------------
112
#endif
113
//---------------------------------------------------------------------------
114
115