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 (polymake::perl::Object* pc);
64 gfan::ZCone* PmPolytope2ZPolytope (polymake::perl::Object* pp);
65 gfan::ZFan* PmFan2ZFan (polymake::perl::Object* pf);
66 polymake::perl::Object* ZCone2PmCone (gfan::ZCone* zc);
67 polymake::perl::Object* ZPolytope2PmPolytope (gfan::ZCone* zc);
68 polymake::perl::Object* ZFan2PmFan (gfan::ZFan* zf);
69 
70 #endif
71 #endif
intvec * PmSetInteger2Intvec(polymake::Set< polymake::Integer > *si, bool &b)
number PmInteger2Number(const polymake::Integer &pi)
polymake::Rational GfRational2PmRational(const gfan::Rational &gr)
gfan::ZMatrix PmMatrixInteger2GfZMatrix(const polymake::Matrix< polymake::Integer > *mi)
Definition: lists.h:22
polymake::perl::Object * ZPolytope2PmPolytope(gfan::ZCone *zc)
Matrices of numbers.
Definition: bigintmat.h:51
polymake::perl::Object * ZFan2PmFan(gfan::ZFan *zf)
gfan::QMatrix PmMatrixRational2GfQMatrix(const polymake::Matrix< polymake::Rational > *mr)
lists PmIncidenceMatrix2ListOfIntvecs(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
polymake::perl::Object * ZCone2PmCone(gfan::ZCone *zc)
polymake::Matrix< polymake::Integer > GfZMatrix2PmMatrixInteger(const gfan::ZMatrix *zm)
polymake::Vector< polymake::Integer > Intvec2PmVectorInteger(const intvec *iv)
CanonicalForm b
Definition: cfModGcd.cc:4044
Definition: intvec.h:17
gfan::ZCone * PmPolytope2ZPolytope(polymake::perl::Object *pp)
gfan::ZFan * PmFan2ZFan(polymake::perl::Object *pf)
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:253
bigintmat * PmMatrixInteger2Bigintmat(polymake::Matrix< polymake::Integer > *mi)
polymake::Matrix< polymake::Integer > Intvec2PmMatrixInteger(const intvec *im)
polymake::Integer GfInteger2PmInteger(const gfan::Integer &gi)
polymake::Matrix< polymake::Rational > GfQMatrix2PmMatrixRational(const gfan::QMatrix *qm)
#define pi
Definition: libparse.cc:1143
intvec * PmVectorInteger2Intvec(const polymake::Vector< polymake::Integer > *vi, bool &ok)
lists PmAdjacencyMatrix2ListOfEdges(polymake::IncidenceMatrix< polymake::NonSymmetric > *icmat)
int PmInteger2Int(const polymake::Integer &pi, bool &ok)
gfan::Rational PmRational2GfRational(const polymake::Rational &pr)
gfan::ZCone * PmCone2ZCone(polymake::perl::Object *pc)
intvec * PmMatrixInteger2Intvec(polymake::Matrix< polymake::Integer > *mi, bool &ok)
gfan::Integer PmInteger2GfInteger(const polymake::Integer &pi)