Changeset 32d8cb in git
- Timestamp:
- Oct 25, 2013, 8:34:39 PM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 9cf75aab8ce4766fcf49c2135012db6957300a95
- Parents:
- 6a6ae29f7bcf2272aa28c90bb17f8e9a0337de6e62de8de7d677c1aa9a6da3c0e58b04a58a9a884b
- Files:
-
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
dyn_modules/callgfanlib/bbcone.cc
r6a6ae2 r32d8cb 170 170 } 171 171 172 void* bbcone_Init(blackbox *b)172 void* bbcone_Init(blackbox* /*b*/) 173 173 { 174 174 return (void*)(new gfan::ZCone()); … … 229 229 } 230 230 231 char * bbcone_String(blackbox *b, void *d)231 char* bbcone_String(blackbox* /*b*/, void *d) 232 232 { 233 233 if (d==NULL) return omStrDup("invalid object"); … … 239 239 } 240 240 241 void bbcone_destroy(blackbox *b, void *d)241 void bbcone_destroy(blackbox* /*b*/, void *d) 242 242 { 243 243 if (d!=NULL) … … 248 248 } 249 249 250 void* bbcone_Copy(blackbox* b, void *d)250 void* bbcone_Copy(blackbox* /*b*/, void *d) 251 251 { 252 252 gfan::ZCone* zc = (gfan::ZCone*)d; … … 622 622 { 623 623 leftv u = args; 624 if ((u != NULL) && (u->Typ() == coneID ))624 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 625 625 { 626 626 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 638 638 { 639 639 leftv u = args; 640 if ((u != NULL) && (u->Typ() == coneID ))640 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 641 641 { 642 642 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 653 653 { 654 654 leftv u = args; 655 if ((u != NULL) && (u->Typ() == coneID ))655 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 656 656 { 657 657 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 661 661 return FALSE; 662 662 } 663 if ((u != NULL) && (u->Typ() == polytopeID))664 {665 gfan::ZCone* zc = (gfan::ZCone*)u->Data();666 res->rtyp = BIGINTMAT_CMD;667 res->data = (void*) getFacetNormals(zc);668 return FALSE;669 }670 663 WerrorS("facets: unexpected parameters"); 671 664 return TRUE; … … 675 668 { 676 669 leftv u = args; 677 if ((u != NULL) && (u->Typ() == coneID ))670 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 678 671 { 679 672 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 690 683 { 691 684 leftv u = args; 692 if ((u != NULL) && (u->Typ() == coneID ))685 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 693 686 { 694 687 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 705 698 { 706 699 leftv u = args; 707 if ((u != NULL) && (u->Typ() == coneID ))700 if ((u != NULL) && (u->Typ() == coneID || u->Typ() == polytopeID)) 708 701 { 709 702 gfan::ZCone* zc = (gfan::ZCone*)u->Data(); … … 1646 1639 1647 1640 1641 lists listOfFacets(const gfan::ZCone &zc) 1642 { 1643 gfan::ZMatrix inequalities = zc.getFacets(); 1644 gfan::ZMatrix equations = zc.getImpliedEquations(); 1645 lists L = (lists)omAllocBin(slists_bin); 1646 int r = inequalities.getHeight(); 1647 int c = inequalities.getWidth(); 1648 L->Init(r); 1649 1650 /* next we iterate over each of the r facets, build the respective cone and add it to the list */ 1651 /* this is the i=0 case */ 1652 gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c); 1653 gfan::ZMatrix newEquations = equations; 1654 newEquations.appendRow(inequalities[0]); 1655 L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations); 1656 1657 /* these are the cases i=1,...,r-2 */ 1658 for (int i=1; i<r-1; i++) 1659 { 1660 newInequalities = inequalities.submatrix(0,0,i-1,c); 1661 newInequalities.append(inequalities.submatrix(i+1,0,r,c)); 1662 newEquations = equations; 1663 newEquations.appendRow(inequalities[i]); 1664 L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations); 1665 } 1666 1667 /* this is the i=r-1 case */ 1668 newInequalities = inequalities.submatrix(0,0,r-1,c); 1669 newEquations = equations; 1670 newEquations.appendRow(inequalities[r]); 1671 L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations); 1672 1673 return L; 1674 } 1675 1676 1677 BOOLEAN listOfFacets(leftv res, leftv args) 1678 { 1679 leftv u=args; 1680 if ((u != NULL) && (u->Typ() == coneID)) 1681 { 1682 gfan::ZCone* zc = (gfan::ZCone*) u->Data(); 1683 lists L = listOfFacets(*zc); 1684 res->rtyp = LIST_CMD; 1685 res->data = (void*) L; 1686 return FALSE; 1687 } 1688 WerrorS("listOfFacets: unexpected parameters"); 1689 return TRUE; 1690 } 1691 1692 1648 1693 poly initial(poly p) 1649 1694 { … … 1684 1729 ideal I = (ideal) u->Data(); 1685 1730 ideal inI = idInit(IDELEMS(I)); 1686 poly g; poly h; long d;1731 poly g; 1687 1732 for (int i=0; i<IDELEMS(I); i++) 1688 1733 { … … 1908 1953 p->iiAddCproc("","uniquePoint",FALSE,uniquePoint); 1909 1954 p->iiAddCproc("","listContainsCone",FALSE,containsCone); 1955 p->iiAddCproc("","listOfFacets",FALSE,listOfFacets); 1910 1956 p->iiAddCproc("","maximalGroebnerCone",FALSE,maximalGroebnerCone); 1911 1957 p->iiAddCproc("","groebnerCone",FALSE,groebnerCone); -
dyn_modules/callgfanlib/bbfan.cc
r6a6ae2 r32d8cb 25 25 int fanID; 26 26 27 void* bbfan_Init(blackbox *b)27 void* bbfan_Init(blackbox* /*b*/) 28 28 { 29 29 return (void*) new gfan::ZFan(0); 30 30 } 31 31 32 void bbfan_destroy(blackbox *b, void *d)32 void bbfan_destroy(blackbox* /*b*/, void *d) 33 33 { 34 34 if (d!=NULL) … … 39 39 } 40 40 41 char* bbfan_String(blackbox *b, void *d)41 char* bbfan_String(blackbox* /*b*/, void *d) 42 42 { 43 43 if (d==NULL) return omStrDup("invalid object"); … … 50 50 } 51 51 52 void* bbfan_Copy(blackbox* b, void *d)52 void* bbfan_Copy(blackbox* /*b*/, void *d) 53 53 { 54 54 gfan::ZFan* zf = (gfan::ZFan*)d; … … 502 502 leftv w=v->next; int n = 1; 503 503 if ((w != NULL) && (w->Typ() == INT_CMD)) 504 intn = (int)(long) w;504 n = (int)(long) w; 505 505 506 506 if (n != 0) … … 864 864 } 865 865 866 lists listOfFacets(const gfan::ZCone &zc)867 {868 gfan::ZMatrix inequalities = zc.getFacets();869 gfan::ZMatrix equations = zc.getImpliedEquations();870 lists L = (lists)omAllocBin(slists_bin);871 int r = inequalities.getHeight();872 int c = inequalities.getWidth();873 L->Init(r);874 875 /* next we iterate over each of the r facets, build the respective cone and add it to the list */876 /* this is the i=0 case */877 gfan::ZMatrix newInequalities = inequalities.submatrix(1,0,r,c);878 gfan::ZMatrix newEquations = equations;879 newEquations.appendRow(inequalities[0]);880 L->m[0].rtyp = coneID; L->m[0].data=(void*) new gfan::ZCone(newInequalities,newEquations);881 882 /* these are the cases i=1,...,r-2 */883 for (int i=1; i<r-1; i++)884 {885 newInequalities = inequalities.submatrix(0,0,i-1,c);886 newInequalities.append(inequalities.submatrix(i+1,0,r,c));887 newEquations = equations;888 newEquations.appendRow(inequalities[i]);889 L->m[i].rtyp = coneID; L->m[i].data=(void*) new gfan::ZCone(newInequalities,newEquations);890 }891 892 /* this is the i=r-1 case */893 newInequalities = inequalities.submatrix(0,0,r-1,c);894 newEquations = equations;895 newEquations.appendRow(inequalities[r]);896 L->m[r-1].rtyp = coneID; L->m[r-1].data=(void*) new gfan::ZCone(newInequalities,newEquations);897 898 return L;899 }900 901 BOOLEAN listOfFacets(leftv res, leftv args)902 {903 leftv u=args;904 if ((u != NULL) && (u->Typ() == coneID))905 {906 gfan::ZCone* zc = (gfan::ZCone*) u->Data();907 lists L = listOfFacets(*zc);908 res->rtyp = LIST_CMD;909 res->data = (void*) L;910 return FALSE;911 }912 WerrorS("listOfFacets: unexpected parameters");913 return TRUE;914 }915 866 916 867 BOOLEAN tropicalVariety(leftv res, leftv args) -
dyn_modules/callgfanlib/bbpolytope.cc
r6a6ae2 r32d8cb 38 38 } 39 39 40 void *bbpolytope_Init(blackbox *b)40 void *bbpolytope_Init(blackbox* /*b*/) 41 41 { 42 42 return (void*)(new gfan::ZCone()); … … 97 97 } 98 98 99 char* bbpolytope_String(blackbox *b, void *d)99 char* bbpolytope_String(blackbox* /*b*/, void *d) 100 100 { if (d==NULL) return omStrDup("invalid object"); 101 101 else … … 107 107 } 108 108 109 void bbpolytope_destroy(blackbox *b, void *d)109 void bbpolytope_destroy(blackbox* /*b*/, void *d) 110 110 { 111 111 if (d!=NULL) … … 116 116 } 117 117 118 void* bbpolytope_Copy(blackbox* b, void *d)118 void* bbpolytope_Copy(blackbox* /*b*/, void *d) 119 119 { 120 120 gfan::ZCone* zc = (gfan::ZCone*)d; … … 358 358 WerrorS("vertices: unexpected parameters"); 359 359 return TRUE; 360 }361 362 bigintmat* getFacetNormals(gfan::ZCone* zc)363 {364 gfan::ZMatrix zmat = zc->getFacets();365 return zMatrixToBigintmat(zmat);366 360 } 367 361 … … 482 476 // iiAddCproc("","getCodimension",FALSE,getAmbientDimension); 483 477 // iiAddCproc("","getDimension",FALSE,getDimension); 484 // iiAddCproc("","getFacetNormals",FALSE,getFacetNormals);485 478 /********************************************************/ 486 479 /* the following functions are identical to those in bbcone.cc */ 480 // iiAddCproc("","facets",FALSE,facets); 487 481 // iiAddCproc("","setLinearForms",FALSE,setLinearForms); 488 482 // iiAddCproc("","getLinearForms",FALSE,getLinearForms); -
dyn_modules/callgfanlib/gfan.h
r6a6ae2 r32d8cb 261 261 }; 262 262 lists lprepareResult(gcone *gc, const int n); 263 static int64 int64gcd(const int64 &a, const int64 &b); 264 static int intgcd(const int &a, const int &b); 265 static int dotProduct(const int64vec &iva, const int64vec &ivb); 266 static bool isParallel(const int64vec &a, const int64vec &b); 267 static int64vec *ivNeg(/*const*/ int64vec *iv); 268 static void idDebugPrint(const ideal &I); 269 static volatile void showSLA(facet &f); 270 static bool isMonomial(const ideal &I); 271 static bool ivAreEqual(const int64vec &a, const int64vec &b); 272 static bool areEqual2(facet *f, facet *g); 273 static bool areEqual( facet *f, facet *g); 263 /* static int64 int64gcd(const int64 &a, const int64 &b); */ 264 /* static int intgcd(const int &a, const int &b); */ 265 /* static int dotProduct(const int64vec &iva, const int64vec &ivb); */ 266 /* static bool isParallel(const int64vec &a, const int64vec &b); */ 267 /* static int64vec *ivNeg(/\*const*\/ int64vec *iv); */ 268 /* static void idDebugPrint(const ideal &I); */ 269 /* static volatile void showSLA(facet &f); */ 270 /* static bool isMonomial(const ideal &I); */ 271 /* static bool ivAreEqual(const int64vec &a, const int64vec &b); */ 272 /* static bool areEqual2(facet *f, facet *g); */ 273 /* static bool areEqual( facet *f, facet *g); */ 274 274 // bool iv64isStrictlyPositive(int64vec *); 275 275 #endif -
dyn_modules/callgfanlib/gitfan.cc
r6a6ae2 r32d8cb 40 40 gfan::ZVector v = f.interiorPoint; 41 41 gfan::ZVector w = f.facetNormal; 42 assume(c.ambientDimension() == v.size());43 assume(c.ambientDimension() == w.size());42 assume(c.ambientDimension() == (int)v.size()); 43 assume(c.ambientDimension() == (int)w.size()); 44 44 assume(c.contains(v)); 45 45 assume(!c.contains(w)); … … 53 53 { 54 54 #ifndef NDEBUG 55 assume(c.ambientDimension() == v.size());56 assume(c.ambientDimension() == w.size());55 assume(c.ambientDimension() == (int)v.size()); 56 assume(c.ambientDimension() == (int)w.size()); 57 57 assume(c.contains(v)); 58 58 assume(!c.contains(w)); … … 66 66 gfan::ZVector v = this->interiorPoint; 67 67 gfan::ZVector w = this->facetNormal; 68 assume(c.ambientDimension() == v.size());69 assume(c.ambientDimension() == w.size());68 assume(c.ambientDimension() == (int)v.size()); 69 assume(c.ambientDimension() == (int)w.size()); 70 70 assume(c.contains(v)); 71 71 assume(!c.contains(w)); … … 114 114 return F; 115 115 116 int index = 0;116 // int index = 0; 117 117 /* next we iterate over each of the r facets, build the respective cone and add it to the list */ 118 118 /* this is the i=0 case */ -
dyn_modules/callpolymake/Makefile.am
r6a6ae2 r32d8cb 10 10 11 11 # forcefully enable exceptions for polymake 12 POLYMAKE_CFLAGS = -fexceptions 12 POLYMAKE_CFLAGS = -fexceptions -frtti 13 13 14 14 AM_LDFLAGS = -release ${PACKAGE_VERSION} ${PM_LDFLAGS} … … 16 16 SOURCES = polymake_conversion.cc polymake_documentation.cc polymake_wrapper.cc 17 17 18 CXXFLAGS += $(POLYMAKE_CXXFLAGS) 19 18 20 polymake_la_SOURCES = $(SOURCES) 19 21 20 22 MYINCLUDES = -I${top_srcdir} -I${top_builddir} -I${srcdir} \ 21 -I${top_srcdir}/libpolys -I${top_builddir}/libpolys \ 22 $(GMP_CFLAGS) ${PM_INC} ${PM_CFLAGS} ${POLYMAKE_CFLAGS} 23 -I${top_srcdir}/libpolys -I${top_builddir}/libpolys \ 24 -I${top_builddir}/factory/include $(GMP_CFLAGS) $(PM_INC) $(PM_CFLAGS) \ 25 $(POLYMAKE_CFLAGS) $(FACTORY_CFLAGS) 23 26 24 27 P_PROCS_CPPFLAGS_COMMON = -DDYNAMIC_VERSION -
dyn_modules/callpolymake/polymake_conversion.cc
r6a6ae2 r32d8cb 7 7 #include <polymake/Set.h> 8 8 #include <polymake/common/lattice_tools.h> 9 // #include <polymake/perl/macros.h> 10 // #include <polymake/IncidenceMatrix.h> 9 #include <polymake/IncidenceMatrix.h> 11 10 12 11 #include <gfanlib/gfanlib.h> … … 14 13 15 14 #include <kernel/mod2.h> 16 // #include <kernel/structs.h>17 // #include <kernel/febase.h>18 15 #include <libpolys/misc/intvec.h> 19 20 // #include <callgfanlib/bbcone.h> 21 // #include <callgfanlib/bbfan.h> 22 // #include <callgfanlib/bbpolytope.h> 23 24 // #include <Singular/blackbox.h> 25 // #include <Singular/ipshell.h> 26 // #include <Singular/subexpr.h> 27 // #include <Singular/tok.h> 28 16 #include <libpolys/coeffs/numbers.h> 17 #include <libpolys/coeffs/bigintmat.h> 18 #include <Singular/lists.h> 19 #include <Singular/ipid.h> // for bigints, 20 // is there really nothing better than this? 29 21 30 22 /* Functions for converting Integers, Rationals and their Matrices … … 136 128 } 137 129 130 number PmInteger2Number (const polymake::Integer& pi) 131 { 132 mpz_class cache(pi.get_rep()); 133 long m = 268435456; 134 if(mpz_cmp_si(cache.get_mpz_t(),m)) 135 { 136 int temp = (int) mpz_get_si(cache.get_mpz_t()); 137 return n_Init(temp,coeffs_BIGINT); 138 } 139 else 140 return n_InitMPZ(cache.get_mpz_t(),coeffs_BIGINT); 141 } 142 138 143 intvec* PmVectorInteger2Intvec (const polymake::Vector<polymake::Integer>* vi, bool &ok) 139 144 { … … 161 166 } 162 167 163 // intvec* PmIncidenceMatrix2Intvec (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat) 164 // { 165 // int rows = icmat->rows(); 166 // int cols = icmat->cols(); 167 // intvec* iv = new intvec(rows,cols,0); 168 // for (int r = 1; r <= rows; r++) 169 // for (int c = 1; c <= cols; c++) 170 // IMATELEM(*iv,r,c) = (int) (*icmat).row(r).exists(c); 171 // return iv; 172 // } 168 bigintmat* PmMatrixInteger2Bigintmat (polymake::Matrix<polymake::Integer>* mi) 169 { 170 int rows = mi->rows(); 171 int cols = mi->cols(); 172 bigintmat* bim= new bigintmat(rows,cols,coeffs_BIGINT); 173 const polymake::Integer* pi = concat_rows(*mi).begin(); 174 for (int r = 1; r <= rows; r++) 175 for (int c = 1; c <= cols; c++) 176 { 177 number temp = PmInteger2Number(*pi); 178 bim->set(r,c,temp); 179 n_Delete(&temp,coeffs_BIGINT); 180 pi++; 181 } 182 return bim; 183 } 184 185 lists PmIncidenceMatrix2ListOfIntvecs (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat) 186 { 187 int rows = icmat->rows(); 188 int cols = icmat->cols(); 189 lists L = (lists)omAllocBin(slists_bin); 190 L->Init(rows); 191 192 for (int r = 0; r < rows; r++) 193 { 194 intvec* iv = new intvec(cols); int i=0; 195 for (int c = 0; c < cols; c++) 196 { 197 if ((*icmat).row(r).exists(c)) 198 { (*iv)[i]=c; i++; } 199 } 200 iv->resize(i); 201 L->m[r].rtyp = INTVEC_CMD; 202 L->m[r].data = (void*) iv; 203 } 204 205 return L; 206 } 207 208 lists PmAdjacencyMatrix2ListOfEdges (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat) 209 { 210 int rows = icmat->rows(); 211 int cols = icmat->cols(); 212 213 // counting number of edges 214 int i=0; int r, c; 215 for (r=0; r<rows; r++) 216 { 217 for (c=0; c<cols; c++) 218 { 219 if ((*icmat).row(r).exists(c) && r<c) 220 i++; 221 } 222 } 223 224 lists L = (lists)omAllocBin(slists_bin); 225 L->Init(i); 226 227 i=0; 228 for (r=0; r<rows; r++) 229 { 230 for (c=0; c<cols; c++) 231 { 232 if ((*icmat).row(r).exists(c) && r<c) 233 { 234 intvec* iv = new intvec(2); 235 (*iv)[0]=r; (*iv)[1]=c; 236 L->m[i].rtyp = INTVEC_CMD; 237 L->m[i].data = (void*) iv; 238 i++; 239 } 240 } 241 } 242 243 return L; 244 } 173 245 174 246 intvec* PmSetInteger2Intvec (polymake::Set<polymake::Integer>* si, bool &b) -
dyn_modules/callpolymake/polymake_conversion.h
r6a6ae2 r32d8cb 3 3 4 4 #include <kernel/mod2.h> 5 6 #ifdef HAVE_FANS7 5 8 6 #include <gmpxx.h> … … 14 12 #include <polymake/Set.h> 15 13 #include <polymake/common/lattice_tools.h> 14 #include <polymake/IncidenceMatrix.h> 16 15 17 16 #include <gfanlib/gfanlib.h> 18 17 #include <gfanlib/gfanlib_q.h> 19 18 19 #include <libpolys/coeffs/numbers.h> 20 #include <libpolys/coeffs/bigintmat.h> 20 21 #include <libpolys/misc/intvec.h> 22 #include <Singular/lists.h> 21 23 22 24 /* Functions for converting Integers, Rationals and their Matrices … … 43 45 intvec* PmVectorInteger2Intvec (const polymake::Vector<polymake::Integer>* vi, bool &ok); 44 46 intvec* PmMatrixInteger2Intvec (polymake::Matrix<polymake::Integer>* mi, bool &ok); 45 // intvec* PmIncidenceMatrix2Intvec (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat); 47 lists PmIncidenceMatrix2ListOfIntvecs (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat); 48 lists PmAdjacencyMatrix2ListOfEdges (polymake::IncidenceMatrix<polymake::NonSymmetric>* icmat); 46 49 intvec* PmSetInteger2Intvec (polymake::Set<polymake::Integer>* si, bool &b); 50 number PmInteger2Number (const polymake::Integer& pi); 51 bigintmat* PmMatrixInteger2Bigintmat (polymake::Matrix<polymake::Integer>* mi); 47 52 48 53 /* polymake <- singular */ … … 62 67 63 68 #endif 64 #endif -
dyn_modules/callpolymake/polymake_documentation.cc
r6a6ae2 r32d8cb 1 #include <polymake_conversion.h>2 3 #include <callgfanlib/bbcone.h>4 #include <callgfanlib/bbfan.h>5 #include <callgfanlib/bbpolytope.h>6 7 #include <Singular/blackbox.h>8 #include <Singular/ipshell.h>9 #include <Singular/subexpr.h>10 1 #include <Singular/ipid.h> 11 2 … … 204 195 module_help_proc("polymake.so","normalFan", normalFan_help); 205 196 197 const char* vertexAdjacencyGraph_help = 198 "USAGE: vertexAdjacencyGraph(polytope p)\nRETURN: list,\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example visual shows an example\n"; 199 200 module_help_proc("polymake.so","vertexAdjacencyGraph", normalFan_help); 201 202 const char* vertexEdgeGraph_help = 203 "USAGE: vertexEdgeGraph(polytope p)\nRETURN: list,\nKEYWORDS: polytopes; polymake;\nEXAMPLE: example visual shows an example\n"; 204 205 module_help_proc("polymake.so","vertexEdgeGraph", normalFan_help); 206 206 207 } -
dyn_modules/callpolymake/polymake_documentation.h
r6a6ae2 r32d8cb 4 4 #include <kernel/mod2.h> 5 5 6 #ifdef HAVE_FANS7 8 6 #include <polymake_conversion.h> 9 7 10 #include < callgfanlib/bbcone.h>11 #include < callgfanlib/bbfan.h>12 #include < callgfanlib/bbpolytope.h>8 #include <dyn_modules/callgfanlib/bbcone.h> 9 #include <dyn_modules/callgfanlib/bbfan.h> 10 #include <dyn_modules/callgfanlib/bbpolytope.h> 13 11 14 12 #include <Singular/blackbox.h> … … 22 20 23 21 #endif 24 #endif -
dyn_modules/callpolymake/polymake_wrapper.cc
r6a6ae2 r32d8cb 1 1 #include <polymake_conversion.h> 2 2 #include <polymake_documentation.h> 3 #include <polymake/Graph.h> 3 4 4 5 #include <dyn_modules/callgfanlib/bbcone.h> … … 1680 1681 } 1681 1682 1683 1684 BOOLEAN PMvertexAdjacencyGraph(leftv res, leftv args) 1685 { 1686 leftv u = args; 1687 if ((u != NULL) && (u->Typ() == polytopeID)) 1688 { 1689 gfan::ZCone* zp = (gfan::ZCone*) u->Data(); 1690 lists output=(lists)omAllocBin(slists_bin); output->Init(2); 1691 try 1692 { 1693 polymake::perl::Object* p = ZPolytope2PmPolytope(zp); 1694 polymake::Matrix<polymake::Integer> vert0 = p->give("VERTICES"); 1695 bigintmat* vert1 = PmMatrixInteger2Bigintmat(&vert0); 1696 output->m[0].rtyp = BIGINTMAT_CMD; 1697 output->m[0].data = (void*) vert1; 1698 1699 polymake::Graph<> gr=p->give("GRAPH.ADJACENCY"); 1700 polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr); 1701 lists listOfEdges = PmIncidenceMatrix2ListOfIntvecs(&adj); 1702 output->m[1].rtyp = LIST_CMD; 1703 output->m[1].data = (void*) listOfEdges; 1704 delete p; 1705 } 1706 catch (const std::exception& ex) 1707 { 1708 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1709 return TRUE; 1710 } 1711 res->rtyp = LIST_CMD; 1712 res->data = (void*) output; 1713 return FALSE; 1714 } 1715 WerrorS("vertexEdgeGraph: unexpected parameters"); 1716 return TRUE; 1717 } 1718 1719 1720 BOOLEAN PMvertexEdgeGraph(leftv res, leftv args) 1721 { 1722 leftv u = args; 1723 if ((u != NULL) && (u->Typ() == polytopeID)) 1724 { 1725 gfan::ZCone* zp = (gfan::ZCone*) u->Data(); 1726 lists output=(lists)omAllocBin(slists_bin); output->Init(2); 1727 try 1728 { 1729 polymake::perl::Object* p = ZPolytope2PmPolytope(zp); 1730 polymake::Matrix<polymake::Integer> vert0 = p->give("VERTICES"); 1731 bigintmat* vert1 = PmMatrixInteger2Bigintmat(&vert0); 1732 output->m[0].rtyp = BIGINTMAT_CMD; 1733 output->m[0].data = (void*) vert1; 1734 1735 polymake::Graph<> gr=p->give("GRAPH.ADJACENCY"); 1736 polymake::IncidenceMatrix<polymake::NonSymmetric> adj = adjacency_matrix(gr); 1737 lists listOfEdges = PmAdjacencyMatrix2ListOfEdges(&adj); 1738 output->m[1].rtyp = LIST_CMD; 1739 output->m[1].data = (void*) listOfEdges; 1740 delete p; 1741 } 1742 catch (const std::exception& ex) 1743 { 1744 WerrorS("ERROR: "); WerrorS(ex.what()); WerrorS("\n"); 1745 return TRUE; 1746 } 1747 res->rtyp = LIST_CMD; 1748 res->data = (void*) output; 1749 return FALSE; 1750 } 1751 WerrorS("vertexEdgeGraph: unexpected parameters"); 1752 return TRUE; 1753 } 1754 1755 1682 1756 extern "C" int mod_init(SModulFunctions* p) 1683 1757 { … … 1685 1759 {init_polymake = new polymake::Main();} 1686 1760 init_polymake->set_application("fan"); 1687 // iiAddCproc("","cube",FALSE,cube); 1688 // iiAddCproc("","cross",FALSE,cross); 1689 //p->iiAddCproc("polymake.so","coneViaPoints",FALSE,PMconeViaRays); 1690 p->iiAddCproc("polymake.so","polytopeViaVertices",FALSE,PMpolytopeViaVertices); 1761 // p->iiAddCproc("polymake.so","coneViaPoints",FALSE,PMconeViaRays); 1762 // p->iiAddCproc("polymake.so","polytopeViaPoints",FALSE,PMpolytopeViaVertices); 1691 1763 p->iiAddCproc("polymake.so","isLatticePolytope",FALSE,PMisLatticePolytope); 1692 1764 p->iiAddCproc("polymake.so","isBounded",FALSE,PMisBounded); … … 1702 1774 p->iiAddCproc("polymake.so","latticeCodegree",FALSE,PMlatticeCodegree); 1703 1775 p->iiAddCproc("polymake.so","ehrhartPolynomialCoeff",FALSE,PMehrhartPolynomialCoeff); 1704 //p->iiAddCproc("polymake.so","fVector",FALSE,PMfVector);1776 p->iiAddCproc("polymake.so","fVector",FALSE,PMfVector); 1705 1777 p->iiAddCproc("polymake.so","hVector",FALSE,PMhVector); 1706 1778 p->iiAddCproc("polymake.so","hStarVector",FALSE,PMhStarVector); … … 1727 1799 p->iiAddCproc("polymake.so","visual",FALSE,visual); 1728 1800 p->iiAddCproc("polymake.so","normalFan",FALSE,normalFan); 1729 // iiAddCproc("","testingtypes",FALSE,testingtypes); 1730 // iiAddCproc("","testingintvec",FALSE,testingintvec); 1731 // iiAddCproc("","testingcones",FALSE,testingcones); 1732 // iiAddCproc("","testingpolytopes",FALSE,testingpolytopes); 1733 // iiAddCproc("","testingfans",FALSE,testingfans); 1734 // iiAddCproc("","testingvisuals",FALSE,testingvisuals); 1735 // iiAddCproc("","testingstrings",FALSE,testingstrings); 1736 // iiAddCproc("","testingmatrices",FALSE,testingmatrices); 1737 // iiAddCproc("","loadPolymakeDocumentation",FALSE,loadPolymakeDocumentation); 1801 p->iiAddCproc("polymake.so","vertexAdjacencyGraph",FALSE,PMvertexAdjacencyGraph); 1802 p->iiAddCproc("polymake.so","vertexEdgeGraph",FALSE,PMvertexEdgeGraph); 1738 1803 1739 1804 blackbox* b=getBlackboxStuff(polytopeID); -
gfanlib/gfanlib_matrix.h
r6a6ae2 r32d8cb 69 69 void appendRow(Vector<typ> const &v) 70 70 { 71 assert( v.size()==width);71 assert((int)v.size()==width); 72 72 rows.push_back(v); 73 73 height++; … … 410 410 { 411 411 assert(typ::isField()); 412 assert( v.size()==getWidth());412 assert((int)v.size()==getWidth()); 413 413 414 414 int pivotI=-1; -
gfanlib/gfanlib_polyhedralfan.cpp
r6a6ae2 r32d8cb 352 352 353 353 bool notAll=false; 354 for( intj=0;j<theCone.indices.size();j++)354 for(unsigned j=0;j<theCone.indices.size();j++) 355 355 if(dot(rays[theCone.indices[j]],facetCandidates[i]).sign()==0) 356 356 indices.insert(theCone.indices[j]); … … 395 395 void addFacesToSymmetricComplex(SymmetricComplex &c, ZCone const &cone, ZMatrix const &facetCandidates, ZMatrix const &generatorsOfLinealitySpace) 396 396 { 397 ZMatrix const &rays=c.getVertices();397 // ZMatrix const &rays=c.getVertices(); 398 398 std::set<int> indices; 399 399 … … 502 502 } 503 503 504 std::string PolyhedralFan::toString(int flags)const504 std::string PolyhedralFan::toString(int /*flags*/)const 505 505 //void PolyhedralFan::printWithIndices(class Printer *p, bool printMultiplicities, SymmetryGroup *sym, bool group, bool ignoreCones, bool xml, bool tPlaneSort, vector<string> const *comments)const 506 506 { -
gfanlib/gfanlib_polymakefile.cpp
r6a6ae2 r32d8cb 53 53 list<int> ret; 54 54 int c=s.peek(); 55 while(( c>='0') && (c<='9')|| (c==' '))55 while(((c>='0') && (c<='9')) || (c==' ')) 56 56 { 57 57 // fprintf(Stderr,"?\n"); … … 66 66 namespace gfan{ 67 67 PolymakeProperty::PolymakeProperty(const std::string &name_, const std::string &value_): 68 name(name_),69 value(value_)68 value(value_), 69 name(name_) 70 70 { 71 71 } … … 271 271 272 272 273 bool PolymakeFile::readBooleanProperty(const char * p)273 bool PolymakeFile::readBooleanProperty(const char */*p*/) 274 274 { 275 275 return false; … … 277 277 278 278 279 void PolymakeFile::writeBooleanProperty(const char * p, bool n)279 void PolymakeFile::writeBooleanProperty(const char */*p*/, bool /*n*/) 280 280 { 281 281 } … … 322 322 stringstream t; 323 323 324 if(comments)assert( comments->size()>=m.getHeight());324 if(comments)assert((int)comments->size()>=m.getHeight()); 325 325 if(isXml) 326 326 { … … 389 389 { 390 390 t<<"<incidence_matrix>"; 391 for( inti=0;i<m.size();i++)391 for(unsigned i=0;i<m.size();i++) 392 392 { 393 393 t<<"<set>"; … … 405 405 else 406 406 { 407 for( inti=0;i<m.size();i++)407 for(unsigned i=0;i<m.size();i++) 408 408 { 409 409 t<<'{'; … … 445 445 { 446 446 t<<"<vector>"; 447 for( inti=0;i<v.size();i++)447 for(unsigned i=0;i<v.size();i++) 448 448 { 449 449 if(i!=0)t<<" "; … … 454 454 else 455 455 { 456 for( inti=0;i<v.size();i++)456 for(unsigned i=0;i<v.size();i++) 457 457 { 458 458 if(i!=0)t<<" "; -
gfanlib/gfanlib_q.h
r6a6ae2 r32d8cb 156 156 return mpq_sgn(value); 157 157 } 158 static Rational gcd(Rational const &a, Rational const &b, Rational &s, Rational &t)158 static Rational gcd(Rational const &a, Rational const /*&b*/, Rational /*&s*/, Rational /*t*/) 159 159 { 160 160 /* mpz_t r; -
gfanlib/gfanlib_symmetriccomplex.cpp
r6a6ae2 r32d8cb 15 15 16 16 SymmetricComplex::Cone::Cone(std::set<int> const &indices_, int dimension_, Integer multiplicity_, bool sortWithSymmetry, SymmetricComplex const &complex): 17 isKnownToBeNonMaximalFlag(false), 17 18 dimension(dimension_), 18 19 multiplicity(multiplicity_), 19 isKnownToBeNonMaximalFlag(false),20 20 sortKeyPermutation(complex.n) 21 21 { … … 27 27 ZMatrix const &vertices=complex.getVertices(); 28 28 ZVector sum(vertices.getWidth()); 29 for( inti=0;i<indices.size();i++)29 for(unsigned i=0;i<indices.size();i++) 30 30 sum+=vertices[indices[i]]; 31 31 … … 56 56 ZMatrix const &vertices=complex.getVertices(); 57 57 ZVector sum(vertices.getWidth()); 58 for( inti=0;i<indices.size();i++)58 for(unsigned i=0;i<indices.size();i++) 59 59 sum+=vertices[indices[i]]; 60 60 … … 62 62 Permutation const &bestPermutation=sortKeyPermutation; 63 63 64 assert( bestPermutation.size()==n);64 assert((int)bestPermutation.size()==n); 65 65 66 66 IntVector indicesNew(indices.size()); 67 67 int I=0; 68 for( inti=0;i<indices.size();i++,I++)68 for(unsigned i=0;i<indices.size();i++,I++) 69 69 { 70 70 ZVector ny=bestPermutation.apply(complex.vertices[indices[i]]); … … 80 80 { 81 81 std::set<int> ret; 82 for( inti=0;i<indices.size();i++)82 for(unsigned i=0;i<indices.size();i++) 83 83 ret.insert(indices[i]); 84 84 … … 89 89 { 90 90 int next=0; 91 for( inti=0;i<indices.size();i++)91 for(unsigned i=0;i<indices.size();i++) 92 92 { 93 93 while(1) 94 94 { 95 if(next>= c.indices.size())return false;95 if(next>=(int)c.indices.size())return false; 96 96 if(indices[i]==c.indices[next])break; 97 97 next++; … … 105 105 { 106 106 std::set<int> r; 107 for( inti=0;i<indices.size();i++)107 for(unsigned i=0;i<indices.size();i++) 108 108 { 109 109 ZVector ny=permutation.apply(complex.vertices[indices[i]]); … … 139 139 { 140 140 ZMatrix l; 141 for( inti=0;i<indices.size();i++)141 for(unsigned i=0;i<indices.size();i++) 142 142 l.appendRow(complex.vertices[indices[i]]); 143 143 … … 150 150 SymmetricComplex::SymmetricComplex(ZMatrix const &rays, ZMatrix const &linealitySpace_, SymmetryGroup const &sym_): 151 151 n(rays.getWidth()), 152 linealitySpace(canonicalizeSubspace(linealitySpace_)), 152 153 sym(sym_), 153 dimension(-1), 154 linealitySpace(canonicalizeSubspace(linealitySpace_)) 154 dimension(-1) 155 155 { 156 156 assert(rays.getWidth()==linealitySpace.getWidth()); … … 222 222 } 223 223 224 /* 224 #if 0 225 225 IntVector SymmetricComplex::dimensionsAtInfinity()const 226 226 { … … 228 228 dimension of the intersection of each cone in the complex with 229 229 the plane x_0=0 */ 230 /*231 230 IntVector ret(cones.size()); 232 231 … … 247 246 return ret; 248 247 } 249 */ 248 #endif 250 249 251 250 void SymmetricComplex::buildConeLists(bool onlyMaximal, bool compressed, std::vector<std::vector<IntVector > >*conelist/*, ZMatrix *multiplicities*/)const … … 259 258 int numberOfOrbitsOutput=0; 260 259 int numberOfOrbitsOfThisDimension=0; 261 bool newDimension=true;260 // bool newDimension=true; 262 261 { 263 262 int I=0; 264 263 for(ConeContainer::const_iterator i=cones.begin();i!=cones.end();i++,I++) 265 266 267 264 if(i->dimension==d) 265 { 266 numberOfOrbitsOfThisDimension++; 268 267 if(!onlyMaximal || isMaximal(*i)) 269 268 { 270 269 numberOfOrbitsOutput++; 271 bool isMax=isMaximal(*i);272 bool newOrbit=true;270 // bool isMax=isMaximal(*i); 271 // bool newOrbit=true; 273 272 std::set<std::set<int> > temp; 274 275 273 for(SymmetryGroup::ElementContainer::const_iterator k=sym.elements.begin();k!=sym.elements.end();k++) 274 { 276 275 Cone temp1=i->permuted(*k,*this,false); 277 276 temp.insert(temp1.indexSet()); … … 291 290 *multiplicities << std::endl; 292 291 }*/ 293 newOrbit=false;294 newDimension=false;292 // newOrbit=false; 293 // newDimension=false; 295 294 } 296 }297 298 } 299 } 300 301 } 302 303 std::string SymmetricComplex::toStringJustCones(int dimLow, int dimHigh, bool onlyMaximal, bool group, std::ostream *multiplicities, bool compressed, bool tPlaneSort)const295 } 296 } 297 } 298 } 299 300 } 301 302 std::string SymmetricComplex::toStringJustCones(int dimLow, int dimHigh, bool onlyMaximal, bool group, std::ostream *multiplicities, bool compressed, bool /*tPlaneSort*/)const 304 303 { 305 304 std::stringstream ret; … … 392 391 { 393 392 bool isBounded=true; 394 for( intj=0;j<i->indices.size();j++)393 for(unsigned j=0;j<i->indices.size();j++) 395 394 if(vertices[i->indices[j]][0].sign()==0)isBounded=false; 396 395 doAdd=isBounded; … … 692 691 { 693 692 ZMatrix generators(indices.size(),getAmbientDimension()); 694 for( inti=0;i<indices.size();i++)693 for(unsigned i=0;i<indices.size();i++) 695 694 generators[i]=vertices[indices[i]]; 696 695 return ZCone::givenByRays(generators,linealitySpace); -
gfanlib/gfanlib_symmetry.cpp
r6a6ae2 r32d8cb 25 25 TrieNode(IntVector const &v, int i) 26 26 { 27 if(i<v.size())27 if(i<(int)v.size()) 28 28 m[v[i]]=TrieNode(v,i+1); 29 29 } … … 31 31 { 32 32 int ret=0; 33 if(i== v.size())return 1;33 if(i==(int)v.size())return 1; 34 34 for(Map::const_iterator j=m.begin();j!=m.end();j++) 35 35 { … … 41 41 void search(ZVector const &v, ZVector &building, Permutation &tempPerm, Permutation &ret, ZVector &optimal, int i, bool &isImproving)const 42 42 { 43 if(i==v.size()){ret=tempPerm;optimal=building;isImproving=false;return;}43 if(i==(int)v.size()){ret=tempPerm;optimal=building;isImproving=false;return;} 44 44 if(isImproving) 45 45 building[i]=-0x7fffffff; … … 61 61 void searchStabalizer(ZVector const &v, ZVector &building, Permutation &tempPerm, Permutation &ret, ZVector &optimal, int i, bool &isImproving, ZVector const &toBeFixed)const 62 62 { 63 if(i==v.size())63 if(i==(int)v.size()) 64 64 if(!(tempPerm.apply(v)<optimal)) 65 65 { … … 102 102 void insert(Permutation const &v, int i) 103 103 { 104 if(i==v.size())return;104 if(i==(int)v.size())return; 105 105 if(m.count(v[i])) 106 106 m[v[i]].insert(v,i+1); … … 132 132 int n; 133 133 Trie(int n_): 134 n(n_),135 theTree(Permutation(n_),0)134 theTree(Permutation(n_),0), 135 n(n_) 136 136 { 137 137 } … … 276 276 IntVector ret(size()); 277 277 assert(size()==b.size()); 278 for( inti=0;i<size();i++)ret[i]=b[(*this)[i]];278 for(unsigned i=0;i<size();i++)ret[i]=b[(*this)[i]]; 279 279 return Permutation(ret); 280 280 } … … 284 284 IntVector ret(size()); 285 285 assert(size()==b.size()); 286 for( inti=0;i<size();i++)ret[(*this)[i]]=b[i];286 for(unsigned i=0;i<size();i++)ret[(*this)[i]]=b[i]; 287 287 return Permutation(ret); 288 288 } … … 292 292 IntVector ret(size()); 293 293 assert(size()==v.size()); 294 for( inti=0;i<size();i++)ret[i]=v[(*this)[i]];294 for(unsigned i=0;i<size();i++)ret[i]=v[(*this)[i]]; 295 295 return ret; 296 296 } … … 300 300 ZVector ret(size()); 301 301 assert(size()==v.size()); 302 for( inti=0;i<size();i++)ret[i]=v[(*this)[i]];302 for(unsigned i=0;i<size();i++)ret[i]=v[(*this)[i]]; 303 303 return ret; 304 304 } … … 309 309 ZVector ret(size()); 310 310 assert(size()==v.size()); 311 for( inti=0;i<size();i++)ret[(*this)[i]]=v[i];311 for(unsigned i=0;i<size();i++)ret[(*this)[i]]=v[i]; 312 312 return ret; 313 313 } … … 431 431 ZVector Permutation::fundamentalDomainInequality()const 432 432 { 433 for( inti=0;i<size();i++)434 if((*this)[i]!= i)433 for(unsigned i=0;i<size();i++) 434 if((*this)[i]!=(int)i) 435 435 return ZVector::standardVector(size(),i)-ZVector::standardVector(size(),(*this)[i]); 436 436 return ZVector(size()); -
gfanlib/gfanlib_vector.h
r6a6ae2 r32d8cb 101 101 if(size()<b.size())return true; 102 102 if(size()>b.size())return false; 103 for( inti=0;i<size();i++)103 for(unsigned i=0;i<size();i++) 104 104 { 105 105 if(v[i]<b[i])return true; … … 156 156 return pq*pq==pp*qq; 157 157 */ 158 intn=p.size();158 unsigned n=p.size(); 159 159 assert(n==q.size()); 160 inti;160 unsigned i; 161 161 for(i=0;i<n;i++) 162 162 { … … 167 167 typ a=p.v[i]; 168 168 typ b=q.v[i]; 169 for( intj=0;j<n;j++)169 for(unsigned j=0;j<n;j++) 170 170 if(a*q.v[j]!=b*p.v[j])return false; 171 171 return true; … … 175 175 // Arithmetic slow 176 176 //----------------- 177 inline friend Vector operator*(typ s, const Vector& q){Vector p=q;for( inti=0;i<q.size();i++)p[i]*=s;return p;}177 inline friend Vector operator*(typ s, const Vector& q){Vector p=q;for(unsigned i=0;i<q.size();i++)p[i]*=s;return p;} 178 178 // inline friend Vektor operator/(const Vektor& q, typ s){Vektor p=q;for(int i=0;i<q.size();i++)p[i]/=s;return p;} 179 179 /* inline friend Vector operator*(const Vektor& p, const Vektor& q){assert(p.size()==q.size());Vektor p1=p;for(int i=0;i<p.size();i++)p1.v[i]*=q.v[i];return p1;} … … 181 181 */ 182 182 inline friend Vector operator/(const Vector& p, typ const &s){Vector ret(p.size());for(unsigned i=0;i<p.size();i++)ret[i]=p[i]/s;return ret;} 183 inline friend Vector operator+(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for( inti=0;i<p.size();i++)p1[i]+=q[i];return p1;}184 inline friend Vector operator-(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for( inti=0;i<p.size();i++)p1[i]-=q[i];return p1;}185 inline friend Vector max(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for( inti=0;i<p.size();i++)if(p1[i]<q[i])p1[i]=q[i];return p1;}186 inline friend Vector min(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for( inti=0;i<p.size();i++)if(p1[i]>q[i])p1[i]=q[i];return p1;}183 inline friend Vector operator+(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for(unsigned i=0;i<p.size();i++)p1[i]+=q[i];return p1;} 184 inline friend Vector operator-(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for(unsigned i=0;i<p.size();i++)p1[i]-=q[i];return p1;} 185 inline friend Vector max(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for(unsigned i=0;i<p.size();i++)if(p1[i]<q[i])p1[i]=q[i];return p1;} 186 inline friend Vector min(const Vector& p, const Vector& q){assert(p.size()==q.size());Vector p1=p;for(unsigned i=0;i<p.size();i++)if(p1[i]>q[i])p1[i]=q[i];return p1;} 187 187 188 188 friend Vector operator-(const Vector &b) 189 189 { 190 190 Vector ret(b.size()); 191 for( inti=0;i<b.size();i++)ret[i]=-b[i];191 for(unsigned i=0;i<b.size();i++)ret[i]=-b[i]; 192 192 return ret; 193 193 } … … 226 226 { 227 227 assert(begin>=0); 228 assert(end<= size());228 assert(end<=(int)size()); 229 229 assert(end>=begin); 230 230 Vector ret(end-begin); … … 293 293 typ temp1,temp2; 294 294 typ ret(1); 295 for( inti=0;i<size();i++)295 for(unsigned i=0;i<size();i++) 296 296 ret=typ::gcd(ret,v[i],temp1,temp2); 297 297 return ret; -
gfanlib/gfanlib_zcone.cpp
r6a6ae2 r32d8cb 44 44 dd_colrange d_input,j; 45 45 dd_RepresentationType rep=dd_Inequality; 46 dd_boolean found=dd_FALSE, newformat=dd_FALSE, successful=dd_FALSE;47 char command[dd_linelenmax], comsave[dd_linelenmax];46 // dd_boolean found=dd_FALSE, newformat=dd_FALSE, successful=dd_FALSE; 47 // char command[dd_linelenmax], comsave[dd_linelenmax]; 48 48 dd_NumberType NT; 49 49 50 50 (*Error)=dd_NoError; 51 51 52 rep=dd_Inequality; newformat=dd_TRUE;52 rep=dd_Inequality; // newformat=dd_TRUE; 53 53 54 54 m_input=g.getHeight(); … … 70 70 } 71 71 72 successful=dd_TRUE;72 // successful=dd_TRUE; 73 73 74 74 return M; … … 108 108 { 109 109 bool ret; 110 dd_MatrixPtr M=NULL ,M2=NULL,M3=NULL;111 dd_colrange d;110 dd_MatrixPtr M=NULL/*,M2=NULL,M3=NULL*/; 111 // dd_colrange d; 112 112 dd_ErrorType err=dd_NoError; 113 dd_rowset redrows,linrows,ignoredrows, basisrows;114 dd_colset ignoredcols, basiscols;115 dd_DataFileType inputfile;116 FILE *reading=NULL;113 // dd_rowset redrows,linrows,ignoredrows, basisrows; 114 // dd_colset ignoredcols, basiscols; 115 // dd_DataFileType inputfile; 116 // FILE *reading=NULL; 117 117 118 118 cddinitGmp(); … … 121 121 if (err!=dd_NoError) goto _L99; 122 122 123 d=M->colsize;123 // d=M->colsize; 124 124 125 125 static dd_Arow temp; … … 339 339 if(numberOfRows==0)return;//the full space, so description is already irredundant 340 340 341 dd_rowset r=NULL;341 // dd_rowset r=NULL; 342 342 ZMatrix g=inequalities; 343 343 g.append(equations); 344 344 345 dd_LPSolverType solver=dd_DualSimplex;345 // dd_LPSolverType solver=dd_DualSimplex; 346 346 dd_MatrixPtr A=NULL; 347 347 dd_ErrorType err=dd_NoError; … … 402 402 int numberOfRows=numberOfEqualities+numberOfInequalities; 403 403 404 dd_rowset r=NULL;404 // dd_rowset r=NULL; 405 405 ZMatrix g=inequalities; 406 406 g.append(equations); … … 448 448 void dual(ZMatrix const &inequalities, ZMatrix const &equations, ZMatrix &dualInequalities, ZMatrix &dualEquations) 449 449 { 450 int result;450 // int result; 451 451 452 452 dd_MatrixPtr A=NULL; … … 472 472 473 473 return; 474 _L99:475 assert(0);474 // _L99: 475 // assert(0); 476 476 } 477 477 // this procedure is take from cddio.c. … … 556 556 int dim2=inequalities.getHeight(); 557 557 if(dim2==0)return std::vector<std::vector<int> >(); 558 int dimension=inequalities.getWidth();558 // int dimension=inequalities.getWidth(); 559 559 560 560 dd_MatrixPtr A=NULL; … … 603 603 604 604 return ret; 605 _L99:606 assert(0);607 return std::vector<std::vector<int> >();605 // _L99: 606 // assert(0); 607 // return std::vector<std::vector<int> >(); 608 608 } 609 609 … … 707 707 inequalities=LpSolver::fastNormals(inequalities2); 708 708 goto noFallBack; 709 fallBack://alternativ (disabled)710 lpSolver.removeRedundantRows(inequalities,equations,true);709 // fallBack://alternativ (disabled) 710 // lpSolver.removeRedundantRows(inequalities,equations,true); 711 711 noFallBack:; 712 712 } … … 730 730 } 731 731 732 std::ostream &operator<<(std::ostream &f, ZCone const &c)732 void operator<<(std::ostream &f, ZCone const &c) 733 733 { 734 734 f<<"Ambient dimension:"<<c.n<<std::endl; … … 741 741 742 742 ZCone::ZCone(int ambientDimension): 743 preassumptions(PCP_impliedEquationsKnown|PCP_facetsKnown), 744 state(1), 745 n(ambientDimension), 746 multiplicity(1), 747 linearForms(ZMatrix(0,ambientDimension)), 743 748 inequalities(ZMatrix(0,ambientDimension)), 744 749 equations(ZMatrix(0,ambientDimension)), 745 n(ambientDimension), 746 state(1), 747 preassumptions(PCP_impliedEquationsKnown|PCP_facetsKnown), 750 haveExtremeRaysBeenCached(false) 751 { 752 } 753 754 755 ZCone::ZCone(ZMatrix const &inequalities_, ZMatrix const &equations_, int preassumptions_): 756 preassumptions(preassumptions_), 757 state(0), 758 n(inequalities_.getWidth()), 748 759 multiplicity(1), 749 haveExtremeRaysBeenCached(false), 750 linearForms(ZMatrix(0,ambientDimension)) 751 { 752 } 753 754 755 ZCone::ZCone(ZMatrix const &inequalities_, ZMatrix const &equations_, int preassumptions_): 760 linearForms(ZMatrix(0,inequalities_.getWidth())), 756 761 inequalities(inequalities_), 757 762 equations(equations_), 758 state(0), 759 preassumptions(preassumptions_), 760 multiplicity(1), 761 haveExtremeRaysBeenCached(false), 762 n(inequalities_.getWidth()), 763 linearForms(ZMatrix(0,inequalities_.getWidth())) 763 haveExtremeRaysBeenCached(false) 764 764 { 765 765 assert(preassumptions_<4);//OTHERWISE WE ARE DOING SOMETHING STUPID LIKE SPECIFYING AMBIENT DIMENSION … … 1042 1042 std::vector<std::vector<int> > indices=lpSolver.extremeRaysInequalityIndices(inequalities); 1043 1043 1044 for( inti=0;i<indices.size();i++)1044 for(unsigned i=0;i<indices.size();i++) 1045 1045 { 1046 1046 /* At this point we know lineality space, implied equations and … … 1082 1082 1083 1083 std::vector<int> asVector(inequalities.getHeight()); 1084 for( intj=0;j<indices[i].size();j++){asVector[indices[i][j]]=1;}1084 for(unsigned j=0;j<indices[i].size();j++){asVector[indices[i][j]]=1;} 1085 1085 ZMatrix equations=this->equations; 1086 1086 ZVector theInequality; 1087 1087 1088 for( intj=0;j<asVector.size();j++)1088 for(unsigned j=0;j<asVector.size();j++) 1089 1089 if(asVector[j]) 1090 1090 equations.appendRow(inequalities[j]); … … 1229 1229 ZCone ZCone::faceContaining(ZVector const &v)const 1230 1230 { 1231 assert(n== v.size());1231 assert(n==(int)v.size()); 1232 1232 assert(contains(v)); 1233 1233 ZMatrix newEquations=equations; -
gfanlib/gfanlib_zcone.h
r6a6ae2 r32d8cb 352 352 */ 353 353 // PolyhedralCone projection(int newn)const; 354 friend std::ostream &operator<<(std::ostream &f, ZCone const &c);354 friend void operator<<(std::ostream &f, ZCone const &c); 355 355 }; 356 356 -
gfanlib/gfanlib_zfan.cpp
r6a6ae2 r32d8cb 16 16 { 17 17 assert(dimension>=0); 18 if(dimension>= T.size())return 0;18 if(dimension>=(int)T.size())return 0; 19 19 return T[dimension].size(); 20 20 } … … 162 162 163 163 // log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; 164 for( inti=0;i<cones.size();i++)164 for(unsigned i=0;i<cones.size();i++) 165 165 // if(coneIndices==0 || coneIndices->count(i)) 166 166 { … … 202 202 } 203 203 ZFan::ZFan(ZFan const& f): 204 coneCollection(0), 204 205 complex(0), 205 coneCollection(0),206 206 cones(f.table(0,0)), 207 207 maximalCones(f.table(0,1)), -
m4/flags.m4
r6a6ae2 r32d8cb 87 87 AC_LANG_PUSH([C++]) 88 88 AX_APPEND_COMPILE_FLAGS(${FLAGS}, [CXXFLAGS]) 89 AX_APPEND_COMPILE_FLAGS([-fexceptions -frtti], [POLYMAKE_CXXFLAGS]) 89 90 AC_LANG_POP([C++]) 90 91 91 92 AX_APPEND_LINK_FLAGS(${FLAGS}) 92 93 94 AC_SUBST(POLYMAKE_CXXFLAGS) 95 93 96 if test "x${ENABLE_DEBUG}" == xyes; then 94 97 DBGFLAGS="-g -ftrapv -fdiagnostics-show-option -Wall -Wextra" … … 121 124 fi 122 125 123 124 126 # SING_SHOW_FLAGS([before PROG_C_CC]) 125 127
Note: See TracChangeset
for help on using the changeset viewer.