My Project  UNKNOWN_GIT_VERSION
polymake_conversion.h
Go to the documentation of this file.
1 #ifndef POLYMAKE_CONVERSION_H
2 #define POLYMAKE_CONVERSION_H
3 
4 #include "kernel/mod2.h"
5 
6 #ifdef HAVE_POLYMAKE
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 #include <polymake/IncidenceMatrix.h>
17 
18 #include "gfanlib/gfanlib.h"
19 #include "gfanlib/gfanlib_q.h"
20 
21 #include "coeffs/numbers.h"
22 #include "coeffs/bigintmat.h"
23 #include "misc/intvec.h"
24 #include "Singular/lists.h"
25 
26 /* Functions for converting Integers, Rationals and their Matrices
27  in between C++, gfan, polymake and singular */
28 
29 /* gfan -> polymake */
30 
31 polymake::Integer GfInteger2PmInteger (const gfan::Integer& gi);
32 polymake::Rational GfRational2PmRational (const gfan::Rational& gr);
33 polymake::Vector<polymake::Integer> Intvec2PmVectorInteger (const intvec* iv);
34 polymake::Matrix<polymake::Integer> GfZMatrix2PmMatrixInteger (const gfan::ZMatrix* zm);
35 polymake::Matrix<polymake::Rational> GfQMatrix2PmMatrixRational (const gfan::QMatrix* qm);
36 
37 /* gfan <- polymake */
38 
39 gfan::Integer PmInteger2GfInteger (const polymake::Integer& pi);
40 gfan::Rational PmRational2GfRational (const polymake::Rational& pr);
41 gfan::ZMatrix PmMatrixInteger2GfZMatrix (const polymake::Matrix<polymake::Integer>* mi);
42 gfan::QMatrix PmMatrixRational2GfQMatrix (const polymake::Matrix<polymake::Rational>* mr);
43 
44 /* polymake -> singular */
45 
46 int PmInteger2Int(const polymake::Integer& pi, bool &ok);
47 intvec* PmVectorInteger2Intvec (const polymake::Vector<polymake::Integer>* vi, bool &ok);
48 intvec* PmMatrixInteger2Intvec (polymake::Matrix<polymake::Integer>* mi, bool &ok);
49 lists PmIncidenceMatrix2ListOfIntvecs (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat);
50 lists PmAdjacencyMatrix2ListOfEdges (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat);
51 intvec* PmSetInteger2Intvec (polymake::Set<polymake::Integer>* si, bool &b);
52 number PmInteger2Number (const polymake::Integer& pi);
53 bigintmat* PmMatrixInteger2Bigintmat (polymake::Matrix<polymake::Integer>* mi);
54 
55 /* polymake <- singular */
56 
57 polymake::Matrix<polymake::Integer> Intvec2PmMatrixInteger (const intvec* im);
58 
59 
60 /* Functions for converting cones and fans in between gfan and polymake,
61  Singular shares the same cones and fans with gfan */
62 
63 gfan::ZCone* PmCone2ZCone (pm::perl::BigObject* pc);
64 gfan::ZCone* PmPolytope2ZPolytope (pm::perl::BigObject* pp);
65 gfan::ZFan* PmFan2ZFan (pm::perl::BigObject* pf);
66 pm::perl::BigObject* ZCone2PmCone (gfan::ZCone* zc);
67 pm::perl::BigObject* ZPolytope2PmPolytope (gfan::ZCone* zc);
68 pm::perl::BigObject* ZFan2PmFan (gfan::ZFan* zf);
69 
70 #endif
71 #endif
PmFan2ZFan
gfan::ZFan * PmFan2ZFan(pm::perl::BigObject *pf)
Definition: polymake_conversion.cc:396
GfRational2PmRational
polymake::Rational GfRational2PmRational(const gfan::Rational &gr)
Definition: polymake_conversion.cc:38
Intvec2PmVectorInteger
polymake::Vector< polymake::Integer > Intvec2PmVectorInteger(const intvec *iv)
Definition: polymake_conversion.cc:46
PmMatrixRational2GfQMatrix
gfan::QMatrix PmMatrixRational2GfQMatrix(const polymake::Matrix< polymake::Rational > *mr)
Definition: polymake_conversion.cc:105
PmIncidenceMatrix2ListOfIntvecs
lists PmIncidenceMatrix2ListOfIntvecs(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
Definition: polymake_conversion.cc:200
bigintmat
Definition: bigintmat.h:52
PmInteger2GfInteger
gfan::Integer PmInteger2GfInteger(const polymake::Integer &pi)
Definition: polymake_conversion.cc:80
lists.h
PmSetInteger2Intvec
intvec * PmSetInteger2Intvec(polymake::Set< polymake::Integer > *si, bool &b)
Definition: polymake_conversion.cc:261
PmMatrixInteger2Bigintmat
bigintmat * PmMatrixInteger2Bigintmat(polymake::Matrix< polymake::Integer > *mi)
Definition: polymake_conversion.cc:179
PmCone2ZCone
gfan::ZCone * PmCone2ZCone(pm::perl::BigObject *pc)
Definition: polymake_conversion.cc:283
PmInteger2Int
int PmInteger2Int(const polymake::Integer &pi, bool &ok)
Definition: polymake_conversion.cc:118
PmRational2GfRational
gfan::Rational PmRational2GfRational(const polymake::Rational &pr)
Definition: polymake_conversion.cc:87
GfZMatrix2PmMatrixInteger
polymake::Matrix< polymake::Integer > GfZMatrix2PmMatrixInteger(const gfan::ZMatrix *zm)
Definition: polymake_conversion.cc:56
b
CanonicalForm b
Definition: cfModGcd.cc:4044
bigintmat.h
pi
#define pi
Definition: libparse.cc:1143
GfInteger2PmInteger
polymake::Integer GfInteger2PmInteger(const gfan::Integer &gi)
Definition: polymake_conversion.cc:30
ZFan2PmFan
pm::perl::BigObject * ZFan2PmFan(gfan::ZFan *zf)
Definition: polymake_conversion.cc:523
PmInteger2Number
number PmInteger2Number(const polymake::Integer &pi)
Definition: polymake_conversion.cc:137
PmMatrixInteger2GfZMatrix
gfan::ZMatrix PmMatrixInteger2GfZMatrix(const polymake::Matrix< polymake::Integer > *mi)
Definition: polymake_conversion.cc:94
mod2.h
intvec
Definition: intvec.h:21
GfQMatrix2PmMatrixRational
polymake::Matrix< polymake::Rational > GfQMatrix2PmMatrixRational(const gfan::QMatrix *qm)
Definition: polymake_conversion.cc:67
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
intvec.h
ZPolytope2PmPolytope
pm::perl::BigObject * ZPolytope2PmPolytope(gfan::ZCone *zc)
Definition: polymake_conversion.cc:441
PmVectorInteger2Intvec
intvec * PmVectorInteger2Intvec(const polymake::Vector< polymake::Integer > *vi, bool &ok)
Definition: polymake_conversion.cc:150
PmMatrixInteger2Intvec
intvec * PmMatrixInteger2Intvec(polymake::Matrix< polymake::Integer > *mi, bool &ok)
Definition: polymake_conversion.cc:160
slists
Definition: lists.h:23
Intvec2PmMatrixInteger
polymake::Matrix< polymake::Integer > Intvec2PmMatrixInteger(const intvec *im)
Definition: polymake_conversion.cc:269
PmAdjacencyMatrix2ListOfEdges
lists PmAdjacencyMatrix2ListOfEdges(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
Definition: polymake_conversion.cc:223
PmPolytope2ZPolytope
gfan::ZCone * PmPolytope2ZPolytope(pm::perl::BigObject *pp)
Definition: polymake_conversion.cc:338
ZCone2PmCone
pm::perl::BigObject * ZCone2PmCone(gfan::ZCone *zc)
Definition: polymake_conversion.cc:416
numbers.h