File: dynamic.cpp

package info (click to toggle)
normaliz 3.11.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 40,448 kB
  • sloc: cpp: 48,104; makefile: 2,247; sh: 1
file content (51 lines) | stat: -rw-r--r-- 1,852 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
#include <cstdlib>
#include <vector>
#include <fstream>
#ifdef _OPENMP
#include <omp.h>
#endif
using namespace std;

#include "libnormaliz/libnormaliz.h"

using namespace libnormaliz;

typedef long long Integer;

int main(int argc, char* argv[]) {
    Matrix<Integer> First(24);  // =readMatrix<Integer>("first.mat");
    Cone<Integer> MyCone(Type::inequalities, First);
    MyCone.setVerbose(true);
    MyCone.setFaceCodimBound(2);
    MyCone.compute(ConeProperty::Dynamic, ConeProperty::FaceLattice);
    Matrix<Integer> Second = readMatrix<Integer>("second.mat");
    Second.pretty_print(cout);
    MyCone.modifyCone(Type::inequalities, Second);
    MyCone.compute(ConeProperty::FaceLattice);
    Matrix<Integer> Facets = MyCone.getSupportHyperplanesMatrix();
    MyCone.write_cone_output("MyConeAfterSecond");
    map<dynamic_bitset, int> FL = MyCone.getFaceLattice();
    auto FaceIt = FL.end();
    FaceIt--;
    dynamic_bitset Indicator = FaceIt->first;
    cout << "Codim of last face " << FaceIt->second << endl;
    cout << "Indicator of last face " << Indicator << endl;
    size_t dim = MyCone.getEmbeddingDim();
    Matrix<Integer> FaceEq(0, dim);
    for (size_t i = 0; i < Indicator.size(); ++i) {
        if (Indicator[i])
            FaceEq.append(Facets[i]);
    }
    cout << "Equations of last face" << endl;
    FaceEq.pretty_print(cout);
    Cone<Integer> FaceCone(Type::inequalities, Facets, Type::equations, FaceEq);
    FaceCone.compute(ConeProperty::ExtremeRays);
    cout << " Extreme rays of last face " << endl;
    FaceCone.getExtremeRaysMatrix().pretty_print(cout);
    Matrix<Integer> Third = readMatrix<Integer>("third.mat");
    MyCone.modifyCone(Type::equations, Third);
    MyCone.setFaceCodimBound(1);
    MyCone.compute(ConeProperty::FaceLattice);

    MyCone.write_cone_output("MyConeAfterThird");
}  // end main