1 | #ifndef POLYMAKE_CONVERSION_H |
---|
2 | #define POLYMAKE_CONVERSION_H |
---|
3 | |
---|
4 | #include <kernel/mod2.h> |
---|
5 | |
---|
6 | #ifdef HAVE_FANS |
---|
7 | |
---|
8 | #include <gmpxx.h> |
---|
9 | |
---|
10 | #include <polymake/Main.h> |
---|
11 | #include <polymake/Matrix.h> |
---|
12 | #include <polymake/Rational.h> |
---|
13 | #include <polymake/Integer.h> |
---|
14 | #include <polymake/Set.h> |
---|
15 | #include <polymake/common/lattice_tools.h> |
---|
16 | |
---|
17 | #include <gfanlib/gfanlib.h> |
---|
18 | #include <gfanlib/gfanlib_q.h> |
---|
19 | |
---|
20 | #include <libpolys/misc/intvec.h> |
---|
21 | |
---|
22 | /* Functions for converting Integers, Rationals and their Matrices |
---|
23 | in between C++, gfan, polymake and singular */ |
---|
24 | |
---|
25 | /* gfan -> polymake */ |
---|
26 | |
---|
27 | polymake::Integer GfInteger2PmInteger (const gfan::Integer& gi); |
---|
28 | polymake::Rational GfRational2PmRational (const gfan::Rational& gr); |
---|
29 | polymake::Vector<polymake::Integer> Intvec2PmVectorInteger (const intvec* iv); |
---|
30 | polymake::Matrix<polymake::Integer> GfZMatrix2PmMatrixInteger (const gfan::ZMatrix* zm); |
---|
31 | polymake::Matrix<polymake::Rational> GfQMatrix2PmMatrixRational (const gfan::QMatrix* qm); |
---|
32 | |
---|
33 | /* gfan <- polymake */ |
---|
34 | |
---|
35 | gfan::Integer PmInteger2GfInteger (const polymake::Integer& pi); |
---|
36 | gfan::Rational PmRational2GfRational (const polymake::Rational& pr); |
---|
37 | gfan::ZMatrix PmMatrixInteger2GfZMatrix (const polymake::Matrix<polymake::Integer>* mi); |
---|
38 | gfan::QMatrix PmMatrixRational2GfQMatrix (const polymake::Matrix<polymake::Rational>* mr); |
---|
39 | |
---|
40 | /* polymake -> singular */ |
---|
41 | |
---|
42 | int PmInteger2Int(const polymake::Integer& pi, bool &ok); |
---|
43 | intvec* PmVectorInteger2Intvec (const polymake::Vector<polymake::Integer>* vi, bool &ok); |
---|
44 | intvec* PmMatrixInteger2Intvec (polymake::Matrix<polymake::Integer>* mi, bool &ok); |
---|
45 | // intvec* PmIncidenceMatrix2Intvec (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat); |
---|
46 | intvec* PmSetInteger2Intvec (polymake::Set<polymake::Integer>* si, bool &b); |
---|
47 | |
---|
48 | /* polymake <- singular */ |
---|
49 | |
---|
50 | polymake::Matrix<polymake::Integer> Intvec2PmMatrixInteger (const intvec* im); |
---|
51 | |
---|
52 | |
---|
53 | /* Functions for converting cones and fans in between gfan and polymake, |
---|
54 | Singular shares the same cones and fans with gfan */ |
---|
55 | |
---|
56 | gfan::ZCone* PmCone2ZCone (polymake::perl::Object* pc); |
---|
57 | gfan::ZCone* PmPolytope2ZPolytope (polymake::perl::Object* pp); |
---|
58 | gfan::ZFan* PmFan2ZFan (polymake::perl::Object* pf); |
---|
59 | polymake::perl::Object* ZCone2PmCone (gfan::ZCone* zc); |
---|
60 | polymake::perl::Object* ZPolytope2PmPolytope (gfan::ZCone* zc); |
---|
61 | polymake::perl::Object* ZFan2PmFan (gfan::ZFan* zf); |
---|
62 | |
---|
63 | #endif |
---|
64 | #endif |
---|