File: signed_dec.h

package info (click to toggle)
regina-normal 7.4.1-1.1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 154,244 kB
  • sloc: cpp: 295,026; xml: 9,992; sh: 1,344; python: 1,225; perl: 616; ansic: 138; makefile: 26
file content (134 lines) | stat: -rw-r--r-- 4,970 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
 * Normaliz
 * Copyright (C) 2007-2022  W. Bruns, B. Ichim, Ch. Soeger, U. v. d. Ohe
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 * As an exception, when this program is distributed through (i) the App Store
 * by Apple Inc.; (ii) the Mac App Store by Apple Inc.; or (iii) Google Play
 * by Google Inc., then that store may impose any digital rights management,
 * device limits and/or redistribution restrictions that are required by its
 * terms of service.
 */

#ifndef NORMALIZ_SIGNED_DEC_H
#define NORMALIZ_SIGNED_DEC_H

#include "libnormaliz/general.h"
#include "libnormaliz/matrix.h"
#include "libnormaliz/dynamic_bitset.h"

namespace libnormaliz {
using namespace std;

//---------------------------------------------------------------------------

// Class for the computation of multiplicities via signed decompoasition

template <typename Integer>
class SignedDec {
    template <typename>
    friend class Full_Cone;

   public:
    bool verbose;

    vector<pair<dynamic_bitset, dynamic_bitset> >* SubfacetsBySimplex;
    size_t size_hollow_triangulation;
    size_t dim;
    size_t nr_gen;
    int omp_start_level;
    mpq_class multiplicity;
    mpz_class int_multiplicity;
    long decimal_digits;
    bool approximate;

    mpz_class approx_denominator;

    Integer GradingDenom;

    string Polynomial;
    // nmz_float EuclideanIntegral;
    mpq_class Integral, VirtualMultiplicity;
    nmz_float RawEuclideanIntegral;
    long DegreeOfPolynomial;

    Matrix<Integer> Generators;
    Matrix<Integer> Embedding;  // transformation on the primal side back to cone coordinates
    // Matrix<mpz_class> Genererators_mpz;
    vector<Integer> GradingOnPrimal;
    // Matrix<mpz_class> GradingOnPrimal_mpz;
    Matrix<Integer> CandidatesGeneric;
    vector<Integer> Generic;
    vector<Integer> GenericComputed;

    Matrix<Integer> SimplexDataUnitMat;
    vector<Matrix<Integer> > SimplexDataWork;
    vector<Matrix<Integer> > DualSimplex;

    void first_subfacet(const dynamic_bitset& Subfacet,
                        const bool compute_multiplicity,
                        Matrix<Integer>& PrimalSimplex,
                        mpz_class& MultPrimal,
                        vector<Integer>& DegreesPrimal,
                        Matrix<Integer>& ValuesGeneric);
    void next_subfacet(const dynamic_bitset& Subfacet_next,
                       const dynamic_bitset& Subfacet_start,
                       const Matrix<Integer>& PrimalSimplex,
                       const bool compute_multiplicity,
                       const mpz_class& MultPrimal,
                       mpz_class& NewMult,
                       const vector<Integer>& DegreesPrimal,
                       vector<Integer>& NewDegrees,
                       const Matrix<Integer>& ValuesGeneric,
                       Matrix<Integer>& NewValues);

    SignedDec();
    SignedDec(vector<pair<dynamic_bitset, dynamic_bitset> >& SFS,
              const Matrix<Integer>& Gens,
              const vector<Integer> Grad,
              const int osl);
    bool FindGeneric();
    bool ComputeMultiplicity();
    bool ComputeIntegral(const bool do_virt);
};

class HollowTriangulation {
    template <typename>
    friend class Full_Cone;

    vector<pair<dynamic_bitset, dynamic_bitset> > Triangulation_ind;  // triangulation encoded by bitsets

    size_t nr_gen, dim;

    bool verbose;

    size_t make_hollow_triangulation_inner(const vector<size_t>& Selection,
                                           const vector<key_t>& PatternKey,
                                           const dynamic_bitset& Pattern);
    size_t refine_and_process_selection(vector<size_t>& Selection,
                                        const vector<key_t>& PatternKey,
                                        const dynamic_bitset& Pattern,
                                        size_t& nr_subfacets);
    size_t extend_selection_pattern(vector<size_t>& Selection,
                                    const vector<key_t>& PatternKey,
                                    const dynamic_bitset& Pattern,
                                    size_t& nr_subfacets);
    size_t make_hollow_triangulation();

    HollowTriangulation(vector<pair<dynamic_bitset, dynamic_bitset> >& TriInd, const size_t d, const size_t ng, bool verb);
};

}  // namespace libnormaliz

#endif  // NMZ_CHUNK_H