diff options
43 files changed, 1458 insertions, 81 deletions
diff --git a/math/gfan/Makefile b/math/gfan/Makefile index affca669e6b5..bb651eecd76b 100644 --- a/math/gfan/Makefile +++ b/math/gfan/Makefile @@ -2,12 +2,12 @@ PORTNAME= gfan DISTVERSION= 0.6.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= math -MASTER_SITES= http://home.math.au.dk/jensen/software/gfan/ +MASTER_SITES= https://users-math.au.dk/jensen/software/gfan/ DISTNAME= ${PORTNAME}${DISTVERSION} -MAINTAINER= ports@FreeBSD.org +MAINTAINER= moritz@schmi.tt COMMENT= Software for computing Groebner fans and tropical varieties LICENSE= GPLv2+ @@ -18,17 +18,10 @@ LIB_DEPENDS= libcddgmp.so:math/cddlib \ USES= compiler:c++11-lang gmake localbase -CFLAGS+= -DGMPRATIONAL - OPTIONS_DEFINE= DOCS EXAMPLES -post-patch: - @${REINPLACE_CMD} \ - 's,ADDITIONALLINKOPTIONS = ,ADDITIONALLINKOPTIONS = -L${LOCALBASE}/lib ,' \ - ${WRKSRC}/Makefile - for x in ${WRKSRC}/src/*; \ - do ${REINPLACE_CMD} 's,log2,gfan_log2,g' $$x; \ - done +CFLAGS+= -DGMPRATIONAL +LDFLAGS+= -L${LOCALBASE}/lib do-install: ${INSTALL_PROGRAM} ${WRKSRC}/gfan ${STAGEDIR}${PREFIX}/bin @@ -41,7 +34,7 @@ post-install-DOCS-on: post-install-EXAMPLES-on: @${MKDIR} ${STAGEDIR}${EXAMPLESDIR} - cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} + ${CP} ${WRKSRC}/examples/* ${STAGEDIR}${EXAMPLESDIR} do-test: cd ${WRKSRC} && ./gfan _test diff --git a/math/gfan/files/patch-src_app__doesidealcontain.cpp b/math/gfan/files/patch-src_app__doesidealcontain.cpp new file mode 100644 index 000000000000..1cd29f6f3833 --- /dev/null +++ b/math/gfan/files/patch-src_app__doesidealcontain.cpp @@ -0,0 +1,15 @@ +--- src/app_doesidealcontain.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_doesidealcontain.cpp +@@ -52,9 +52,9 @@ class DoesIdealContainApplication : public GFanApplica + for(PolynomialSet::const_iterator i=b.begin();i!=b.end();i++) + { + Polynomial remainder=division(multiplier* *i,a,LexicographicTermOrder()); +- log2 AsciiPrinter(Stderr).printString("Remainder: "); +- log2 AsciiPrinter(Stderr).printPolynomial(remainder); +- log2 AsciiPrinter(Stderr).printNewLine(); ++ gfan_log2 AsciiPrinter(Stderr).printString("Remainder: "); ++ gfan_log2 AsciiPrinter(Stderr).printPolynomial(remainder); ++ gfan_log2 AsciiPrinter(Stderr).printNewLine(); + if(!remainder.isZero()) + { + log1 AsciiPrinter(Stderr).printString("Polynomial not in ideal: "); diff --git a/math/gfan/files/patch-src_app__fiberpolytope.cpp b/math/gfan/files/patch-src_app__fiberpolytope.cpp new file mode 100644 index 000000000000..e22f81698046 --- /dev/null +++ b/math/gfan/files/patch-src_app__fiberpolytope.cpp @@ -0,0 +1,11 @@ +--- src/app_fiberpolytope.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_fiberpolytope.cpp +@@ -166,7 +166,7 @@ class FiberPolytopeApplication : public GFanApplicatio + for(PolyhedralFan::coneIterator i=f1.conesBegin();i!=f1.conesEnd();i++) + { + static int a; +- log2 cerr<<"Processing Cone "<<a++<<" which has dimension "<<i->dimension()<<endl; ++ gfan_log2 cerr<<"Processing Cone "<<a++<<" which has dimension "<<i->dimension()<<endl; + SecondaryFanTraverser traverser(triangulationWithFullDimensionalIntersection(t,*i),*i); + symmetricTraverse(traverser,target,&s); + } diff --git a/math/gfan/files/patch-src_app__groebnerfan.cpp b/math/gfan/files/patch-src_app__groebnerfan.cpp new file mode 100644 index 000000000000..c0dea502589c --- /dev/null +++ b/math/gfan/files/patch-src_app__groebnerfan.cpp @@ -0,0 +1,20 @@ +--- src/app_groebnerfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_groebnerfan.cpp +@@ -74,7 +74,7 @@ class GroebnerFanApplication : public GFanApplication + { + log1 fprintf(Stderr,"Computing Groebner Basis...\n"); + buchberger(&g,StandardGradedLexicographicTermOrder()); +- log2 AsciiPrinter(Stderr).printPolynomialSet(g); ++ gfan_log2 AsciiPrinter(Stderr).printPolynomialSet(g); + } + log1 fprintf(Stderr,"A reduced Groebner basis has been computed\n"); + +@@ -113,7 +113,7 @@ class GroebnerFanApplication : public GFanApplication + for(PolyhedralFan::coneIterator i=f1.conesBegin();i!=f1.conesEnd();i++) + { + static int t; +- log2 cerr<<"Processing Cone "<<t++<<" which has dimension "<<i->dimension()<<endl; ++ gfan_log2 cerr<<"Processing Cone "<<t++<<" which has dimension "<<i->dimension()<<endl; + GroebnerFanTraverser traverser(groebnerBasisWithFullDimensionalIntersection(g,*i),*i); + SymmetricTargetCounterInterrupted target2(target,optionInterrupt.getValue()); + symmetricTraverse(traverser,target2,&s); diff --git a/math/gfan/files/patch-src_app__main.cpp b/math/gfan/files/patch-src_app__main.cpp new file mode 100644 index 000000000000..bde1a6be233f --- /dev/null +++ b/math/gfan/files/patch-src_app__main.cpp @@ -0,0 +1,11 @@ +--- src/app_main.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_main.cpp +@@ -143,7 +143,7 @@ class GCats : public GFanApplication (public) + { + log1 fprintf(Stderr,"Computing Groebner Basis...\n"); + buchberger(&g,StandardGradedLexicographicTermOrder()); +- log2 AsciiPrinter(Stderr).printPolynomialSet(g); ++ gfan_log2 AsciiPrinter(Stderr).printPolynomialSet(g); + } + log1 fprintf(Stderr,"A reduced Groebner basis has been computed\n"); + } diff --git a/math/gfan/files/patch-src_app__resultantfan.cpp b/math/gfan/files/patch-src_app__resultantfan.cpp new file mode 100644 index 000000000000..b18445099eb3 --- /dev/null +++ b/math/gfan/files/patch-src_app__resultantfan.cpp @@ -0,0 +1,24 @@ +--- src/app_resultantfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_resultantfan.cpp +@@ -164,7 +164,7 @@ class ResultantFanApplication : public GFanApplication + for(IntegerVectorList::const_iterator i=linealityGen.begin();i!=linealityGen.end();i++)temp.push_back(*i); + for(IntegerVectorList::const_iterator i=gen.begin();i!=gen.end();i++)temp.push_back(*i); + +- if(::rank(rowsToIntegerMatrix(temp,N))!=N){log2 debug<<"Skipping\n";continue;} ++ if(::rank(rowsToIntegerMatrix(temp,N))!=N){gfan_log2 debug<<"Skipping\n";continue;} + } + + +@@ -182,10 +182,10 @@ class ResultantFanApplication : public GFanApplication + C.canonicalize(); + // debug<<toNonSpecialSubspace(gen,*special); + // debug<<toNonSpecialSubspace(linealityGen,*special); +- log2 debug<<":"<<C.dimension()<<"\n"; ++ gfan_log2 debug<<":"<<C.dimension()<<"\n"; + if(C.dimension()==n-1) + { +- log2 debug<<"adding\n"; ++ gfan_log2 debug<<"adding\n"; + F.push_back(C); + } + } diff --git a/math/gfan/files/patch-src_app__secondaryfan.cpp b/math/gfan/files/patch-src_app__secondaryfan.cpp new file mode 100644 index 000000000000..5ee8ba98e546 --- /dev/null +++ b/math/gfan/files/patch-src_app__secondaryfan.cpp @@ -0,0 +1,11 @@ +--- src/app_secondaryfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_secondaryfan.cpp +@@ -385,7 +385,7 @@ class SecondaryFanApplication : public GFanApplication + for(PolyhedralFan::coneIterator i=f1.conesBegin();i!=f1.conesEnd();i++) + { + static int a; +- log2 cerr<<"Processing Cone "<<a++<<" which has dimension "<<i->dimension()<<endl; ++ gfan_log2 cerr<<"Processing Cone "<<a++<<" which has dimension "<<i->dimension()<<endl; + SecondaryFanTraverser traverser(triangulationWithFullDimensionalIntersection(t,*i),*i); + SymmetricTargetCounterInterrupted target2(target,optionInterrupt.getValue()); + symmetricTraverse(traverser,target2,&s); diff --git a/math/gfan/files/patch-src_app__tropicalintersection.cpp b/math/gfan/files/patch-src_app__tropicalintersection.cpp new file mode 100644 index 000000000000..b6b4722499a7 --- /dev/null +++ b/math/gfan/files/patch-src_app__tropicalintersection.cpp @@ -0,0 +1,11 @@ +--- src/app_tropicalintersection.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_tropicalintersection.cpp +@@ -37,7 +37,7 @@ class SymmetricTargetTropicalBasisTester : public Symm + bool process(ConeTraverser &traverser) + { + IntegerVector w=traverser.refToPolyhedralCone().getRelativeInteriorPoint(); +- log2 AsciiPrinter(Stderr) << "Testing weight vector:\n"<<w<<"\n"; ++ gfan_log2 AsciiPrinter(Stderr) << "Testing weight vector:\n"<<w<<"\n"; + WeightReverseLexicographicTermOrder T(w); + buchberger(&g,T); + PolynomialSet temp=initialForms(g,w); diff --git a/math/gfan/files/patch-src_app__tropicaltraverse.cpp b/math/gfan/files/patch-src_app__tropicaltraverse.cpp new file mode 100644 index 000000000000..72141837aea7 --- /dev/null +++ b/math/gfan/files/patch-src_app__tropicaltraverse.cpp @@ -0,0 +1,13 @@ +--- src/app_tropicaltraverse.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/app_tropicaltraverse.cpp +@@ -93,8 +93,8 @@ class TropicalTraverseApplication : public GFanApplica + s.computeClosure(generators); + s.createTrie(); + +- log2 s.print(Stderr); +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 s.print(Stderr); ++ gfan_log2 fprintf(Stderr,"\n"); + } + if(optionTorusSymmetry.getValue() && !optionSymmetry.getValue()) + { diff --git a/math/gfan/files/patch-src_bergman.cpp b/math/gfan/files/patch-src_bergman.cpp new file mode 100644 index 000000000000..091bd37c1f76 --- /dev/null +++ b/math/gfan/files/patch-src_bergman.cpp @@ -0,0 +1,117 @@ +--- src/bergman.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/bergman.cpp +@@ -79,15 +79,15 @@ BergmanFan bergmanRayIntersection(PolynomialSet const + // fprintf(Stderr,"---------------------------------------------------------\n"); + + +- log2 cerr<<"BBLABL"; ++ gfan_log2 cerr<<"BBLABL"; + for(IntegerVectorList::const_iterator i=rays.begin();i!=rays.end();i++) + { +- log2 cerr<<"1"; ++ gfan_log2 cerr<<"1"; + PolynomialSet g=idealGroebnerBasis; + g=GE_groebnerBasis(g,WeightReverseLexicographicTermOrder(*i),true,false);//Set to true? + // buchberger(&g,WeightReverseLexicographicTermOrder(*i)); + PolynomialSet cg=initialFormsAssumeMarked(g,*i); +- log2 cerr<<"2"; ++ gfan_log2 cerr<<"2"; + + bool inList=false; + for(BergmanFan::MaximalConeList::const_iterator j=bfan.cones.begin();j!=bfan.cones.end();j++) +@@ -98,14 +98,14 @@ BergmanFan bergmanRayIntersection(PolynomialSet const + break; + } + } +- log2 cerr<<"3"; ++ gfan_log2 cerr<<"3"; + if(!inList) + { + bfan.cones.push_back(BergmanFan::MaximalCone(cg,g,true,maximalConeLabel++)); + } +- log2 cerr<<"4"; ++ gfan_log2 cerr<<"4"; + } +- log2 cerr<<"BBLAB END"; ++ gfan_log2 cerr<<"BBLAB END"; + // AsciiPrinter temp(Stderr); + // bfan.print(temp); + return bfan; +@@ -631,7 +631,7 @@ BergmanFan bergman(PolynomialSet const &coneGroebnerBa + symmetry checks were algebraic and not + geometric*/ + // assert(i->idealGroebnerBasis.isMarked()); +- log2 cerr<<"8"; ++ gfan_log2 cerr<<"8"; + + PolynomialSet g2(theRing); + WeightTermOrder termOrder(termorderWeight(initialIdeal)); +@@ -639,14 +639,14 @@ BergmanFan bergman(PolynomialSet const &coneGroebnerBa + for(PolynomialSet::const_iterator j=i->idealGroebnerBasis.begin();j!=i->idealGroebnerBasis.end();j++) + g2.push_back(divisionLift(*j, initialIdeal, current.idealGroebnerBasis, termOrder)); + assert(g2.isMarked()); +- log2 cerr<<"9"; ++ gfan_log2 cerr<<"9"; + + + if(1) + { +- log2 cerr << "AUTOREDUCTION"; ++ gfan_log2 cerr << "AUTOREDUCTION"; + autoReduce(&g2,LexicographicTermOrder()); +- log2 cerr << "AUTOREDUCTION END"<<endl; ++ gfan_log2 cerr << "AUTOREDUCTION END"<<endl; + } + else + { +@@ -655,17 +655,17 @@ BergmanFan bergman(PolynomialSet const &coneGroebnerBa + log0 cerr << "RESTRICTED AUTOREDUCTION END"<<endl; + } + ConeOrbit tempConeOrbit(*symmetryGroup,i->coneGroebnerBasis,g2,-1); +- log2 cerr<<"0"; ++ gfan_log2 cerr<<"0"; + IntegerVector relIntFacetVector=tempConeOrbit.getStableRay(); + +- log2 cerr<<"A"; ++ gfan_log2 cerr<<"A"; + + int label=-1; + IntegerVector labelPermutation; + if(!active.containsAndMark(relIntFacetVector,relIntRidgeVector,&label,&labelPermutation)) + // if(!active.containsAndMark(i->coneGroebnerBasis,initialIdeal,&label,&labelPermutation)) + { +- log2 cerr<<"B"; ++ gfan_log2 cerr<<"B"; + if(!ret.contains(i->coneGroebnerBasis)) + { + label=maximalConeLabel++; +@@ -680,13 +680,13 @@ BergmanFan bergman(PolynomialSet const &coneGroebnerBa + { + assert(0);//Can this ever happen? REMOVE JAN 2009 + } +- log2 cerr<<"C"; ++ gfan_log2 cerr<<"C"; + } +- log2 cerr<<"D"; ++ gfan_log2 cerr<<"D"; + ret.codimensionOneCones.back().incidenceList.push_back(label); +- log2 cerr<<"E"; ++ gfan_log2 cerr<<"E"; + ret.codimensionOneCones.back().incidencePermutationList.push_back(labelPermutation); +- log2 cerr<<"F"; ++ gfan_log2 cerr<<"F"; + } + } + // else +@@ -898,9 +898,9 @@ PolyhedralFan BergmanFan::toPolyhedralFan()const + //PolyhedralCone c1(wallInequalities(i->idealGroebnerBasis),wallInequalities(i->coneGroebnerBasis)); + // PolyhedralCone c1(wallFlipableNormals(i->idealGroebnerBasis,false),wallInequalities(i->coneGroebnerBasis),n); + PolyhedralCone c1=i->theCone; +- log2 fprintf(Stderr,"Cononicalising...\n"); ++ gfan_log2 fprintf(Stderr,"Cononicalising...\n"); + c1.canonicalize(); +- log2 fprintf(Stderr,"... done canonicalising...\n"); ++ gfan_log2 fprintf(Stderr,"... done canonicalising...\n"); + // fprintf(Stderr,"a\n"); + // for(SymmetryGroup::ElementContainer::const_iterator j=symmetryGroup.elements.begin();j!=symmetryGroup.elements.end();j++) + // { diff --git a/math/gfan/files/patch-src_breadthfirstsearch.cpp b/math/gfan/files/patch-src_breadthfirstsearch.cpp new file mode 100644 index 000000000000..9a09444033d4 --- /dev/null +++ b/math/gfan/files/patch-src_breadthfirstsearch.cpp @@ -0,0 +1,29 @@ +--- src/breadthfirstsearch.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/breadthfirstsearch.cpp +@@ -259,7 +259,7 @@ class Orbit{ (public) + // fprintf(Stderr,"1b\n"); + } + +- log2 fprintf(Stderr,"numFixed = %i\n",numFixed); ++ gfan_log2 fprintf(Stderr,"numFixed = %i\n",numFixed); + return groupSize/numFixed; + } + }; +@@ -368,7 +368,7 @@ void BreadthFirstSearch::enumerate(const PolynomialSet + static int n; + n++; + if(!(n%10)) +- log2 fprintf(Stderr,"%i\n",n); ++ gfan_log2 fprintf(Stderr,"%i\n",n); + } + log3 fprintf(Stderr,"Active set:\n"); + log3 active.print(Stderr); +@@ -484,7 +484,7 @@ void BreadthFirstSearch::enumerate(const PolynomialSet + } + else + { +- // log2 fprintf(Stderr,"-- marked\n"); ++ // gfan_log2 fprintf(Stderr,"-- marked\n"); + } + } + } diff --git a/math/gfan/files/patch-src_buchberger.cpp b/math/gfan/files/patch-src_buchberger.cpp new file mode 100644 index 000000000000..f430bdd99cec --- /dev/null +++ b/math/gfan/files/patch-src_buchberger.cpp @@ -0,0 +1,44 @@ +--- src/buchberger.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/buchberger.cpp +@@ -65,7 +65,7 @@ void buchberger/*Simple*/(PolynomialSet *g, TermOrder + return buchberger2(g, termOrder, allowSaturation); + //return buchbergerChain(g, termOrder, allowSaturation); + PolynomialRing theRing=g->getRing(); +- // log2 fprintf(Stderr,"ENTERING buchberger\n"); ++ // gfan_log2 fprintf(Stderr,"ENTERING buchberger\n"); + TimerScope ts(&buchbergerTimer); + PolynomialSet sPolynomials(theRing); + +@@ -136,11 +136,11 @@ void buchberger/*Simple*/(PolynomialSet *g, TermOrder + // else + // pout<<"ZERO\n"; + } +- //log2 fprintf(Stderr," buchberger minimize\n"); ++ //gfan_log2 fprintf(Stderr," buchberger minimize\n"); + minimize(g); +- //log2 fprintf(Stderr," buchberger autoreduce\n"); ++ //gfan_log2 fprintf(Stderr," buchberger autoreduce\n"); + autoReduce(g,termOrder); +- //log2 fprintf(Stderr,"LEAVING buchberger\n\n"); ++ //gfan_log2 fprintf(Stderr,"LEAVING buchberger\n\n"); + + cerr<<"NumberOfReductions: "<<numberOfReductions<<std::endl; + } +@@ -496,7 +496,7 @@ void buchberger2(PolynomialSet *g, TermOrder const &te + g->push_back(p); + G.push_back(p); + numberOfUsefulCriticalPairs++; +- log2 ++ gfan_log2 + { + static int t; + if(((++t)&=31)==0) +@@ -587,7 +587,7 @@ bool isMarkedGroebnerBasis(PolynomialSet const &g) + int counter=0; + for(PolynomialSet::const_iterator i=g.begin();i!=g.end();i++) + { +- log2 fprintf(Stderr,"%i ",counter++); ++ gfan_log2 fprintf(Stderr,"%i ",counter++); + for(PolynomialSet::const_iterator j=i;j!=g.end();j++) + if(!relativelyPrime(i->getMarked().m.exponent,j->getMarked().m.exponent)) + { diff --git a/math/gfan/files/patch-src_codimoneconnectedness.cpp b/math/gfan/files/patch-src_codimoneconnectedness.cpp new file mode 100644 index 000000000000..422afa447528 --- /dev/null +++ b/math/gfan/files/patch-src_codimoneconnectedness.cpp @@ -0,0 +1,10 @@ +--- src/codimoneconnectedness.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/codimoneconnectedness.cpp +@@ -33,6 +33,6 @@ bool CodimOneConnectednessTester::isConnected()const + g.addEdge(facetIndex,nFacets+(lower_bound(allRidges2.begin(),allRidges2.end(),*j)-allRidges2.begin())); + + int diameter=g.diameter(); +- log2 cerr << "Diameter " << diameter << " nFacets " << nFacets << " nRidges " << nRidges << endl; ++ gfan_log2 cerr << "Diameter " << diameter << " nFacets " << nFacets << " nRidges " << nRidges << endl; + return diameter<nFacets+nRidges; + } diff --git a/math/gfan/files/patch-src_enumeration.cpp b/math/gfan/files/patch-src_enumeration.cpp new file mode 100644 index 000000000000..1fc5b87beb1f --- /dev/null +++ b/math/gfan/files/patch-src_enumeration.cpp @@ -0,0 +1,11 @@ +--- src/enumeration.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/enumeration.cpp +@@ -72,7 +72,7 @@ void EnumerationAlgorithm::printProgress(int step) + // if(!(progressCounter&4095)) + // if(!(progressCounter&255)) + if(!(progressCounter&15)) +- log2 fprintf(Stderr,"Number of Gr\"obner Bases found %i\n",progressCounter); ++ gfan_log2 fprintf(Stderr,"Number of Gr\"obner Bases found %i\n",progressCounter); + fflush(Stderr); + step--; + } diff --git a/math/gfan/files/patch-src_ep__xfig.cpp b/math/gfan/files/patch-src_ep__xfig.cpp new file mode 100644 index 000000000000..8c5aa03dc444 --- /dev/null +++ b/math/gfan/files/patch-src_ep__xfig.cpp @@ -0,0 +1,17 @@ +--- src/ep_xfig.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/ep_xfig.cpp +@@ -75,12 +75,12 @@ bool XfigEnumerationPrinter::basis(const PolynomialSet + } + } + +- log2 xfig->printPolygon(p); ++ gfan_log2 xfig->printPolygon(p); + xfig->drawPolygon(p,0); + + basisCounter++; + +- log2 fprintf(Stderr,"basisCounter:%i\n",basisCounter); ++ gfan_log2 fprintf(Stderr,"basisCounter:%i\n",basisCounter); + + return true; + } diff --git a/math/gfan/files/patch-src_field__rationals.cpp b/math/gfan/files/patch-src_field__rationals.cpp new file mode 100644 index 000000000000..dc087b7d987e --- /dev/null +++ b/math/gfan/files/patch-src_field__rationals.cpp @@ -0,0 +1,11 @@ +--- src/field_rationals.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/field_rationals.cpp +@@ -402,7 +402,7 @@ const char *FieldRationalsImplementation::name() + list=this; + */ + /* +- log2 fprintf(Stderr,"Initializing field Rationals\n"); ++ gfan_log2 fprintf(Stderr,"Initializing field Rationals\n"); + } + */ + //FieldRationals Q; diff --git a/math/gfan/files/patch-src_gfanlib__polyhedralfan.cpp b/math/gfan/files/patch-src_gfanlib__polyhedralfan.cpp new file mode 100644 index 000000000000..fdc1e3db963a --- /dev/null +++ b/math/gfan/files/patch-src_gfanlib__polyhedralfan.cpp @@ -0,0 +1,38 @@ +--- src/gfanlib_polyhedralfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/gfanlib_polyhedralfan.cpp +@@ -221,10 +221,10 @@ PolyhedralFan PolyhedralFan::fullComplex()const + + while(1) + { +- log2 debug<<"looping"; ++ gfan_log2 debug<<"looping"; + bool doLoop=false; + PolyhedralFan facets=ret.facetComplex(); +- log2 debug<<"number of facets"<<facets.size()<<"\n"; ++ gfan_log2 debug<<"number of facets"<<facets.size()<<"\n"; + for(PolyhedralConeList::const_iterator i=facets.cones.begin();i!=facets.cones.end();i++) + if(!ret.contains(*i)) + { +@@ -561,7 +561,7 @@ std::string PolyhedralFan::toString(int flags)const + static int t; + // log1 fprintf(Stderr,"Adding faces of cone %i\n",t++); + } +-// log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); ++// gfan_log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); + + addFacesToSymmetricComplex(symCom,*i,i->getHalfSpaces(),generatorsOfLinealitySpace); + } +@@ -706,11 +706,11 @@ PolyhedralFan PolyhedralFan::readFan(string const &fil + + PolyhedralFan ret(n); + +- log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; ++ gfan_log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; + for(int i=0;i<cones.size();i++) + if(coneIndices==0 || coneIndices->count(i)) + { +- log2 cerr<<"Expanding symmetries of cone"<<endl; ++ gfan_log2 cerr<<"Expanding symmetries of cone"<<endl; + { + IntegerVectorList coneRays; + for(list<int>::const_iterator j=cones[i].begin();j!=cones[i].end();j++) diff --git a/math/gfan/files/patch-src_gfanlib__symmetriccomplex.cpp b/math/gfan/files/patch-src_gfanlib__symmetriccomplex.cpp new file mode 100644 index 000000000000..ecad67dfe9f0 --- /dev/null +++ b/math/gfan/files/patch-src_gfanlib__symmetriccomplex.cpp @@ -0,0 +1,11 @@ +--- src/gfanlib_symmetriccomplex.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/gfanlib_symmetriccomplex.cpp +@@ -554,7 +554,7 @@ IntegerMatrix SymmetricComplex::boundaryMap(int d) + static int t; + // log1 fprintf(Stderr,"Adding faces of cone %i\n",t++); + } +- // log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); ++ // gfan_log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); + + addFacesToSymmetricComplex(symCom,*i,i->getHalfSpaces(),generatorsOfLinealitySpace); + } diff --git a/math/gfan/files/patch-src_gfanlib__zfan.cpp b/math/gfan/files/patch-src_gfanlib__zfan.cpp new file mode 100644 index 000000000000..22786b956acf --- /dev/null +++ b/math/gfan/files/patch-src_gfanlib__zfan.cpp @@ -0,0 +1,16 @@ +--- src/gfanlib_zfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/gfanlib_zfan.cpp +@@ -162,11 +162,11 @@ namespace gfan + + ZFan ret(sym); + +-// log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; ++// gfan_log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; + for(unsigned i=0;i<cones.size();i++) + // if(coneIndices==0 || coneIndices->count(i)) + { +-// log2 cerr<<"Expanding symmetries of cone"<<endl; ++// gfan_log2 cerr<<"Expanding symmetries of cone"<<endl; + { + ZMatrix coneRays(0,n); + for(list<int>::const_iterator j=cones[i].begin();j!=cones[i].end();j++) diff --git a/math/gfan/files/patch-src_halfopencone.cpp b/math/gfan/files/patch-src_halfopencone.cpp new file mode 100644 index 000000000000..faa5f5f4ab65 --- /dev/null +++ b/math/gfan/files/patch-src_halfopencone.cpp @@ -0,0 +1,172 @@ +--- src/halfopencone.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/halfopencone.cpp +@@ -602,7 +602,7 @@ void tropicalHyperSurfaceIntersectionWithProcessor(int + intersectionOld.print(&P); + */ + } +- log2 fprintf(Stderr,"Halfopen intersection completed.\n"); ++ gfan_log2 fprintf(Stderr,"Halfopen intersection completed.\n"); + } + + PolyhedralFan tropicalHyperSurfaceIntersectionClosed(int dimension, PolynomialSet const &g, PolyhedralCone *restrictingCone, bool expand, bool saveResult, int intervalLow, int intervalHigh) +@@ -1296,7 +1296,7 @@ struct RecursionData (public) + + if(index == fans.size()) + { +- log2 fprintf(Stderr,"ADDING CONE\n"); ++ gfan_log2 fprintf(Stderr,"ADDING CONE\n"); + //ret.push_back(current); + processor.process(current,chosenFans,chosen); + numberOfUsefulCalls++; +@@ -1339,7 +1339,7 @@ struct RecursionData (public) + + static int iterationNumber; + if(!(iterationNumber++ & 31)) +- log2 ++ gfan_log2 + { + fprintf(Stderr,"Iteration level:%i, Chosen fan:%i, Number of candidates:%i, Iteration Number:%i, Useful (%i/%i)=%f\n",index,bestIndex,bestNumberOfCandidates,iterationNumber,numberOfUsefulCalls,totalNumberOfCalls,float(numberOfUsefulCalls)/totalNumberOfCalls); + fprintf(Stderr,"Chosen fans vector: "); +@@ -1490,7 +1490,7 @@ struct RecursionData (public) + } + bool closure() + { +- log2 cerr<<"computing closure"<<endl; ++ gfan_log2 cerr<<"computing closure"<<endl; + bool ret=false; + int a=0; + for(int f1=0;f1<fans.size();f1++) +@@ -1532,8 +1532,8 @@ struct RecursionData (public) + } + } + } +- log2 fprintf(Stderr,"%i FOR FREE\n",a); +- log2 cerr<<"done computing closure"<<endl; ++ gfan_log2 fprintf(Stderr,"%i FOR FREE\n",a); ++ gfan_log2 cerr<<"done computing closure"<<endl; + return ret; + } + +@@ -1607,8 +1607,8 @@ struct RecursionData (public) + freeLPs++; + } + // table.print(); +-// log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data2.table.numberOfSolvedLPs); +- log2 fprintf(Stderr,"Number of infeassible LPs discovered from higherdimensional cones: %i\n",freeLPs); ++// gfan_log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data2.table.numberOfSolvedLPs); ++ gfan_log2 fprintf(Stderr,"Number of infeassible LPs discovered from higherdimensional cones: %i\n",freeLPs); + } + }; + +@@ -1630,9 +1630,9 @@ void tropicalHyperSurfaceIntersection(int dimension, P + HalfOpenConeList l,lf; + buildFanFromPolynomial(*i, &lf, &l, &(parents[I]),restrictingCone); + +- log2 AsciiPrinter(Stderr).printVector(parents[I]); ++ gfan_log2 AsciiPrinter(Stderr).printVector(parents[I]); + +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 fprintf(Stderr,"\n"); + + vector<HalfOpenCone> L; + for(HalfOpenConeList::const_iterator i=l.begin();i!=l.end();i++) +@@ -1658,7 +1658,7 @@ void tropicalHyperSurfaceIntersection(int dimension, P + // data.table.print();//HERE + IntegerVectorList empty; + data.rek(0, HalfOpenCone(dimension,empty,empty,empty)); +- log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); ++ gfan_log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); + } + + +@@ -1861,7 +1861,7 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + are gotten as the pull-back of the lower dimensional equations by + this normal form map. + */ +- log2 cerr<<"Projecting Newton polytopes modulo the homogeneity space."; ++ gfan_log2 cerr<<"Projecting Newton polytopes modulo the homogeneity space."; + + int N=G.getRing().getNumberOfVariables(); + IntegerVectorList w=wallInequalities(G); +@@ -1887,7 +1887,7 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + restrictingCone=&restrictedConeNew; + } + +- log2 cerr<<"Done projecting Newton polytopes modulo the homogeneity space."; ++ gfan_log2 cerr<<"Done projecting Newton polytopes modulo the homogeneity space."; + /* + Now do the computation with the new set of polynomials. + */ +@@ -1895,7 +1895,7 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + /* + Here follows restriction to subspace cut out by the binomials. + */ +- log2 cerr<<"Restricting to subspace determined by binomials and computing tropical hypersurfaces."; ++ gfan_log2 cerr<<"Restricting to subspace determined by binomials and computing tropical hypersurfaces."; + + int n=g.getRing().getNumberOfVariables(); + IntegerVectorList equations; +@@ -1937,12 +1937,12 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + for(PolynomialSet::const_iterator i=g.begin();i!=g.end();i++) + if(i->numberOfTerms()!=2) + { +- log2 cerr << I; ++ gfan_log2 cerr << I; + HalfOpenConeList l,lf; +- log2 cerr<< "Building fan"<<endl; ++ gfan_log2 cerr<< "Building fan"<<endl; + buildFanFromPolynomial(*i, &lf, &l, &(parents[I]),restrictingCone); +- log2 cerr<< "Number of cones:" << lf.size()<<","<< l.size()<<endl; +- log2 cerr<< "rewriting"<<endl; ++ gfan_log2 cerr<< "Number of cones:" << lf.size()<<","<< l.size()<<endl; ++ gfan_log2 cerr<< "rewriting"<<endl; + + vector<HalfOpenCone> L; + for(HalfOpenConeList::const_iterator i=l.begin();i!=l.end();i++) +@@ -1953,10 +1953,10 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + + fullDimFanList.push_back(F); + coDimOneFanList.push_back(L); +- log2 cerr<< "Done Building fan"<<endl; ++ gfan_log2 cerr<< "Done Building fan"<<endl; + I++; + } +- log2 cerr<<"Done computing tropical hypersurfaces."; ++ gfan_log2 cerr<<"Done computing tropical hypersurfaces."; + + /* Now we must create a new HalfOpenConeProcessor and tell it how to expand a cone. + We must insert the pivot columns from A and add in the equtions gotten from the binomials. +@@ -1974,12 +1974,12 @@ void tropicalHyperSurfaceIntersectionInSubspace(int di + + + IntegerVectorList empty; +- log2 cerr<<"Doing intersection."; ++ gfan_log2 cerr<<"Doing intersection."; + if(intervalHigh!=-1)data.setInterval(intervalLow,intervalHigh); + data.rek(0, HalfOpenCone(nonPivots.size(),empty,empty,empty)); +- log2 cerr<<"Done doing intersection."; ++ gfan_log2 cerr<<"Done doing intersection."; + // data.rek(0, HalfOpenCone(dimension,empty,empty,empty)); +- // log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); ++ // gfan_log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); + + /* HalfOpenConeList ret; + +@@ -2151,7 +2151,7 @@ bool hasMixedCellOfDimension(PolynomialSet const &g, i + IntegerVectorList empty; + data.rek(0, HalfOpenCone(g.getRing().getNumberOfVariables(),empty,empty,empty)); + +- log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); ++ gfan_log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); + + if(maximalSeen)*maximalSeen=p.getMaximalDimensionFound(); + +@@ -2185,7 +2185,7 @@ bool hasMixedCellOfDimension(list<list<IntegerVector> + IntegerVectorList empty; + data.rek(0, HalfOpenCone(/*g.getRing().getNumberOfVariables()*/d,empty,empty,empty)); + +- log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); ++ gfan_log2 fprintf(Stderr,"LPs solved:%i for relation table\n",data.table.numberOfSolvedLPs); + + if(maximalSeen)*maximalSeen=p.getMaximalDimensionFound(); + diff --git a/math/gfan/files/patch-src_linalg.cpp b/math/gfan/files/patch-src_linalg.cpp new file mode 100644 index 000000000000..e98799c2ff2e --- /dev/null +++ b/math/gfan/files/patch-src_linalg.cpp @@ -0,0 +1,11 @@ +--- src/linalg.cpp.orig 2017-09-08 14:13:16 UTC ++++ src/linalg.cpp +@@ -885,7 +885,7 @@ IntegerVector vectorInKernel(IntegerMatrix const &m) / + return ret; + } + fallback: +- log2 debug << "LINALG FALLBACK\n"; ++ gfan_log2 debug << "LINALG FALLBACK\n"; + + + FieldMatrix m2=integerMatrixToFieldMatrix(m,Q); diff --git a/math/gfan/files/patch-src_log.h b/math/gfan/files/patch-src_log.h new file mode 100644 index 000000000000..9c9eccc05bd5 --- /dev/null +++ b/math/gfan/files/patch-src_log.h @@ -0,0 +1,11 @@ +--- src/log.h.orig 2017-06-20 14:47:37 UTC ++++ src/log.h +@@ -14,7 +14,7 @@ void setLogLevel(int l); + #define log0 if(logLevel>=0) + + #define log1 if(logLevel>=1) +-#define log2 if(logLevel>=2) ++#define gfan_log2 if(logLevel>=2) + #define log3 if(logLevel>=3) + + #endif diff --git a/math/gfan/files/patch-src_lp__soplexcdd.cpp b/math/gfan/files/patch-src_lp__soplexcdd.cpp new file mode 100644 index 000000000000..bb323accacdf --- /dev/null +++ b/math/gfan/files/patch-src_lp__soplexcdd.cpp @@ -0,0 +1,20 @@ +--- src/lp_soplexcdd.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/lp_soplexcdd.cpp +@@ -536,7 +536,7 @@ if(0) { + debug<<"\n"; + D(s); + */ +- log2 fprintf(Stderr,"Solution failed (Type2).\n"); ++ gfan_log2 fprintf(Stderr,"Solution failed (Type2).\n"); + + /* for(int i=0;i<work.nCols();i++) + { +@@ -578,7 +578,7 @@ if(0) { + return false; + } + +- log2 fprintf(Stderr,"Certificate failed (Type2).\n"); ++ gfan_log2 fprintf(Stderr,"Certificate failed (Type2).\n"); + /* std::cerr<< work; + std::cerr<< farkasx; + AsciiPrinter(Stderr).printVector(c); diff --git a/math/gfan/files/patch-src_padic.cpp b/math/gfan/files/patch-src_padic.cpp new file mode 100644 index 000000000000..42edb440f5f2 --- /dev/null +++ b/math/gfan/files/patch-src_padic.cpp @@ -0,0 +1,28 @@ +--- src/padic.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/padic.cpp +@@ -406,14 +406,14 @@ void pAdicBuchberger(PolynomialSet &g, int prime, Inte + for(PolynomialSet::const_iterator i=g.begin();i!=g.end();i++) + for(PolynomialSet::const_iterator j=g.begin();j!=i;j++) + { +-log2 debug<<"checking s poly\n"<<*i<<"("<<ST(*i,prime,omega,tieBreaker)<<")"<<"\n"<<*j<<"("<<ST(*j,prime,omega,tieBreaker)<<")"<<"\n"; ++gfan_log2 debug<<"checking s poly\n"<<*i<<"("<<ST(*i,prime,omega,tieBreaker)<<")"<<"\n"<<*j<<"("<<ST(*j,prime,omega,tieBreaker)<<")"<<"\n"; + Polynomial f=SPolynomial(*i,*j,prime,omega,tieBreaker); + // debug<<"S="<<f<<"\n"; + // Enable the relatively prime criterion by uncommenting this following: + #if 1 + if(relativelyPrime(ST(*i,prime,omega,tieBreaker).m.exponent,ST(*j,prime,omega,tieBreaker).m.exponent)) + { +-log2 debug<<"SKIPPING\n"; ++gfan_log2 debug<<"SKIPPING\n"; + } + else + #endif +@@ -424,7 +424,7 @@ log2 debug<<"SKIPPING\n"; + f=longDivision(f,g,prime,omega,tieBreaker,H,u); + if(!f.isZero()) + { +-log2 debug<<"Adding:"<<f<<"\n"; ++gfan_log2 debug<<"Adding:"<<f<<"\n"; + g.push_back(f); + } + } diff --git a/math/gfan/files/patch-src_polyhedralcone.cpp b/math/gfan/files/patch-src_polyhedralcone.cpp new file mode 100644 index 000000000000..69b836a4cc49 --- /dev/null +++ b/math/gfan/files/patch-src_polyhedralcone.cpp @@ -0,0 +1,11 @@ +--- src/polyhedralcone.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/polyhedralcone.cpp +@@ -879,7 +879,7 @@ IntegerVectorList PolyhedralCone::extremeRays(IntegerV + ret.push_back(u); + else + { +- log2 fprintf(Stderr,"Remember to fix cdd double description interface\n"); ++ gfan_log2 fprintf(Stderr,"Remember to fix cdd double description interface\n"); + } + } + } diff --git a/math/gfan/files/patch-src_polyhedralfan.cpp b/math/gfan/files/patch-src_polyhedralfan.cpp new file mode 100644 index 000000000000..f49a789c6632 --- /dev/null +++ b/math/gfan/files/patch-src_polyhedralfan.cpp @@ -0,0 +1,65 @@ +--- src/polyhedralfan.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/polyhedralfan.cpp +@@ -400,10 +400,10 @@ PolyhedralFan PolyhedralFan::fullComplex()const + + while(1) + { +- log2 debug<<"looping"; ++ gfan_log2 debug<<"looping"; + bool doLoop=false; + PolyhedralFan facets=ret.facetComplex(); +- log2 debug<<"number of facets"<<facets.size()<<"\n"; ++ gfan_log2 debug<<"number of facets"<<facets.size()<<"\n"; + for(PolyhedralConeList::const_iterator i=facets.cones.begin();i!=facets.cones.end();i++) + if(!ret.contains(*i)) + { +@@ -1232,7 +1232,7 @@ void addFacesToSymmetricComplex(SymmetricComplex &c, s + + if(!c.contains(theCone)) + { +- log2 ++ gfan_log2 + { + static int t; + if((t&1023)==0) +@@ -1317,7 +1317,7 @@ SymmetricComplex PolyhedralFan::toSymmetricComplex(Sym + static int t; + log1 fprintf(Stderr,"Adding faces of cone %i\n",t++); + } +- log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); ++ gfan_log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); + + addFacesToSymmetricComplex(symCom,*i,i->getHalfSpaces(),generatorsOfLinealitySpace); + } +@@ -1387,7 +1387,7 @@ void PolyhedralFan::printWithIndices(class Printer *p, + static int t; + log1 fprintf(Stderr,"Adding faces of cone %i\n",t++); + } +- log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); ++ gfan_log2 fprintf(Stderr,"Dim: %i\n",i->dimension()); + + addFacesToSymmetricComplex(symCom,*i,i->getHalfSpaces(),generatorsOfLinealitySpace); + } +@@ -1565,11 +1565,11 @@ PolyhedralFan PolyhedralFan::readFan(string const &fil + + PolyhedralFan ret(n); + +- log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; ++ gfan_log2 cerr<< "Number of orbits to expand "<<cones.size()<<endl; + for(int i=0;i<cones.size();i++) + if(coneIndices==0 || coneIndices->count(i)) + { +- log2 cerr<<"Expanding symmetries of cone"<<endl; ++ gfan_log2 cerr<<"Expanding symmetries of cone"<<endl; + /* for(SymmetryGroup::ElementContainer::const_iterator perm=sym->elements.begin();perm!=sym->elements.end();perm++) + { + IntegerVectorList coneRays; +@@ -1851,7 +1851,7 @@ bool PolyhedralFan::isConnected(SymmetryGroup *sym)con + + for(PolyhedralConeList::const_iterator i=cones.begin();i!=cones.end();i++) + { +- log2 cerr<<"Computing ridges of facet." << endl; ++ gfan_log2 cerr<<"Computing ridges of facet." << endl; + PolyhedralFan ridges=facetsOfCone(*i); + IntegerVectorList interiorPoints; + for(PolyhedralConeList::const_iterator j=ridges.cones.begin();j!=ridges.cones.end();j++) diff --git a/math/gfan/files/patch-src_reversesearch.cpp b/math/gfan/files/patch-src_reversesearch.cpp new file mode 100644 index 000000000000..8584e4fce45c --- /dev/null +++ b/math/gfan/files/patch-src_reversesearch.cpp @@ -0,0 +1,33 @@ +--- src/reversesearch.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/reversesearch.cpp +@@ -65,7 +65,7 @@ int ReverseSearch::treeSize(PolynomialSet &groebnerBas + static int n; + n++; + if(!(n%10)) +- log2 fprintf(Stderr,"%i %i\n",n,depth); ++ gfan_log2 fprintf(Stderr,"%i %i\n",n,depth); + } + + int s=1; +@@ -144,17 +144,17 @@ int ReverseSearch::treeSize(PolynomialSet &groebnerBas + + PolynomialSet ReverseSearch::findRoot(PolynomialSet groebnerBasis) + { +- log2 fprintf(Stderr,"Computing root\n"); +- log2 buchberger(&groebnerBasis,termOrder); ++ gfan_log2 fprintf(Stderr,"Computing root\n"); ++ gfan_log2 buchberger(&groebnerBasis,termOrder); + + IntegerVector edge; + while(computeSearchEdge(groebnerBasis,&edge)) + { +- log2 AsciiPrinter(Stderr).printVector(edge); ++ gfan_log2 AsciiPrinter(Stderr).printVector(edge); + groebnerBasis=flip(groebnerBasis,edge); + } + +- log2 fprintf(Stderr,"Done computing root\n"); ++ gfan_log2 fprintf(Stderr,"Done computing root\n"); + return groebnerBasis; + } + diff --git a/math/gfan/files/patch-src_singular.cpp b/math/gfan/files/patch-src_singular.cpp new file mode 100644 index 000000000000..e3305bc85eb5 --- /dev/null +++ b/math/gfan/files/patch-src_singular.cpp @@ -0,0 +1,28 @@ +--- src/singular.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/singular.cpp +@@ -115,10 +115,10 @@ ring R=mySingularRingDegRevLex(idealGenerators.getRing + test|=(Sy_bit(OPT_REDSB)|Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_INTSTRATEGY)); + test|=(Sy_bit(OPT_REDTHROUGH)); + +- log2 cerr<<"calling singular\n"; ++ gfan_log2 cerr<<"calling singular\n"; + // debug<<"test"<<int(test)<<"\n"; + ideal j=kStd(i,NULL,testHomog,NULL); +- log2 cerr<<"returning from singular\n"; ++ gfan_log2 cerr<<"returning from singular\n"; + + idDelete(&i); + ret=fromSingularIdeal(ret.getRing(),j,R); +@@ -175,10 +175,10 @@ ring R=mySingularRingDegRevLex(idealGenerators.getRing + ideal i=singularPolynomialSet(idealGenerators); + test|=(Sy_bit(OPT_REDSB)|Sy_bit(OPT_REDTAIL)|Sy_bit(OPT_INTSTRATEGY)); + +- log2 cerr<<"calling singular\n"; ++ gfan_log2 cerr<<"calling singular\n"; + ideal j=kStd(i,NULL,testHomog,NULL); + // ideal j=kInterRed(i); +- log2 cerr<<"returning from singular\n"; ++ gfan_log2 cerr<<"returning from singular\n"; + + idDelete(&i); + ret=fromSingularIdeal(ret.getRing(),j,R); diff --git a/math/gfan/files/patch-src_symmetriccomplex.cpp b/math/gfan/files/patch-src_symmetriccomplex.cpp new file mode 100644 index 000000000000..33c9971f48f9 --- /dev/null +++ b/math/gfan/files/patch-src_symmetriccomplex.cpp @@ -0,0 +1,11 @@ +--- src/symmetriccomplex.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/symmetriccomplex.cpp +@@ -509,7 +509,7 @@ bool SymmetricComplex::isPure()const + int dim=-1; + for(ConeContainer::const_iterator i=cones.begin();i!=cones.end();i++) + { +- log2{static int a;if(!((a++)&63))fprintf(Stderr,"%i\n",a);}//log0 ++ gfan_log2{static int a;if(!((a++)&63))fprintf(Stderr,"%i\n",a);}//log0 + if(isMaximal(*i)) + { + int dim2=i->dimension; diff --git a/math/gfan/files/patch-src_symmetry.cpp b/math/gfan/files/patch-src_symmetry.cpp new file mode 100644 index 000000000000..608bdf6c103c --- /dev/null +++ b/math/gfan/files/patch-src_symmetry.cpp @@ -0,0 +1,11 @@ +--- src/symmetry.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/symmetry.cpp +@@ -631,7 +631,7 @@ void SymmetryGroup::createTrie() + int I=0; + for(ElementContainer::const_iterator i=elements.begin();i!=elements.end();i++,I++) + trie->insert(*i,I); +- log2 debug<<"Number of elements";log2 debug.printInteger(trie->size());log2 debug<<"\n"; ++ gfan_log2 debug<<"Number of elements";gfan_log2 debug.printInteger(trie->size());gfan_log2 debug<<"\n"; + log1 debug<<"Done creating symmetry trie.\n"; + + if(0) diff --git a/math/gfan/files/patch-src_traverser__stableintersection.cpp b/math/gfan/files/patch-src_traverser__stableintersection.cpp new file mode 100644 index 000000000000..38b8abbecd22 --- /dev/null +++ b/math/gfan/files/patch-src_traverser__stableintersection.cpp @@ -0,0 +1,20 @@ +--- src/traverser_stableintersection.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/traverser_stableintersection.cpp +@@ -62,7 +62,7 @@ IntegerVectorList StableIntersectionTraverser::link(In + + IntegerVectorList rays1=theLink.getRaysInPrintingOrder(0); + +- log2 { ++ gfan_log2 { + cerr<<"Ray candidates:"<<endl; + AsciiPrinter(Stderr)<<rays1; + } +@@ -80,7 +80,7 @@ IntegerVectorList StableIntersectionTraverser::link(In + rays2.push_back(ray.getUniquePoint()); + // rays2.push_back(*i); + } +- log2{ ++ gfan_log2{ + cerr<<"True rays:"<<endl; + AsciiPrinter(Stderr)<<rays2; + } diff --git a/math/gfan/files/patch-src_traverser__tropical.cpp b/math/gfan/files/patch-src_traverser__tropical.cpp new file mode 100644 index 000000000000..9f311ca46e1f --- /dev/null +++ b/math/gfan/files/patch-src_traverser__tropical.cpp @@ -0,0 +1,75 @@ +--- src/traverser_tropical.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/traverser_tropical.cpp +@@ -41,12 +41,12 @@ void TropicalTraverser::updatePolyhedralCone() + + void TropicalTraverser::changeCone(IntegerVector const &ridgeVector, IntegerVector const &rayVector) + { +-log2 { ++gfan_log2 { + debug << "Interior point:"<<theCone.getUniquePoint()<<"\n"; + debug << "Ridge:"<<ridgeVector<<"Ray:"<<rayVector<<"\n"; + } + assert(idealGroebnerBasis.containsInClosedGroebnerCone(ridgeVector)); +- log2 cerr<<endl<<"Changing cone"<<endl; ++ gfan_log2 cerr<<endl<<"Changing cone"<<endl; + + // assert(!containsMonomial(coneGroebnerBasis)); + +@@ -59,7 +59,7 @@ log2 { + WeightReverseLexicographicTermOrder T(rayVector); + + // P<<ridgeIdeal; +- log2 cerr<<"Computing initial Groebner basis"<<endl; ++ gfan_log2 cerr<<"Computing initial Groebner basis"<<endl; + // buchberger(&ridgeIdeal,T); + + ridgeIdeal=GE_groebnerBasis(ridgeIdeal,T,true,false);//Set to true? +@@ -70,7 +70,7 @@ log2 { + // WeightTermOrder termOrder(termorderWeight(ridgeIdeal)); + WeightTermOrder termOrder(termorderWeight(ridgeIdealOld)); + +- log2 cerr<<"Lifting"<<endl; ++ gfan_log2 cerr<<"Lifting"<<endl; + PolynomialSet temp=ridgeIdealOld; + temp.markAndScale(T); + temp=temp.markedTermIdeal(); +@@ -90,7 +90,7 @@ log2 { + } + assert(g2.isMarked()); + //printMarkedTermIdeal(g2,"g2"); +- log2 cerr<<"Autoreducing"<<endl; ++ gfan_log2 cerr<<"Autoreducing"<<endl; + + // autoReduce(&g2,LexicographicTermOrder()); + //PolynomialSet g2Old=g2; +@@ -117,7 +117,7 @@ log2 { + assert(idealGroebnerBasis.size()==oldSize); + // idealGroebnerBasis=g2; + // assert(!containsMonomial(coneGroebnerBasis)); +- log2 cerr<<"Done changing cone"<<endl<<endl; ++ gfan_log2 cerr<<"Done changing cone"<<endl<<endl; + + // P<<coneGroebnerBasis; + // P<<idealGroebnerBasis; +@@ -136,7 +136,7 @@ log2 { + P<<coneGroebnerBasis; + }*/ + +- log2 cerr << "Number of terms in new basis: "<< g2.totalNumberOfTerms()<<endl; ++ gfan_log2 cerr << "Number of terms in new basis: "<< g2.totalNumberOfTerms()<<endl; + + + updatePolyhedralCone(); +@@ -152,10 +152,10 @@ IntegerVectorList TropicalTraverser::link(IntegerVecto + + //P<<tempIdeal; + +-// log2 D(tempIdeal); ++// gfan_log2 D(tempIdeal); + // tempIdeal=saturatedIdeal(tempIdeal);//TODO: figure out if it is an advantage to saturate the ideal + /* That seems not to be the case. For example on Grassmann 3_8. Here most time would be spent saturating.*/ +-// log2 D(tempIdeal); ++// gfan_log2 D(tempIdeal); + + IntegerVectorList rays; + diff --git a/math/gfan/files/patch-src_triangulation2.h b/math/gfan/files/patch-src_triangulation2.h new file mode 100644 index 000000000000..24c09cf6320a --- /dev/null +++ b/math/gfan/files/patch-src_triangulation2.h @@ -0,0 +1,20 @@ +--- src/triangulation2.h.orig 2017-06-20 14:47:37 UTC ++++ src/triangulation2.h +@@ -602,7 +602,7 @@ using namespace std; + /* void flip(IntegerVector const &normal) + { + AsciiPrinter P(Stderr); +- log2 print(P); ++ gfan_log2 print(P); + //log0 P.printVector(normal); + int n=normal.size(); + // IntegerVectorList l=wallRemoveScaledInequalities(inequalities());// This is not needed - one circuit should be enough +@@ -610,7 +610,7 @@ using namespace std; + for(IntegerVectorList::const_iterator i=l.begin();i!=l.end();i++) + if(dependent(*i,normal)) + { +- log2 AsciiPrinter(Stderr).printVector(*i); ++ gfan_log2 AsciiPrinter(Stderr).printVector(*i); + for(int k=0;k<normal.size();k++) + if((*i)[k]<0) + { diff --git a/math/gfan/files/patch-src_tropical.cpp b/math/gfan/files/patch-src_tropical.cpp new file mode 100644 index 000000000000..edf2777d7408 --- /dev/null +++ b/math/gfan/files/patch-src_tropical.cpp @@ -0,0 +1,11 @@ +--- src/tropical.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/tropical.cpp +@@ -241,7 +241,7 @@ bool containsMonomialDehomogenize(PolynomialSet const + + bool containsMonomial(PolynomialSet const &ideal) + { +- log2 debug<<"containsMonomial() called on input ideal:\n"<<ideal; ++ gfan_log2 debug<<"containsMonomial() called on input ideal:\n"<<ideal; + + // if(ideal.empty())return false; + diff --git a/math/gfan/files/patch-src_tropical2.cpp b/math/gfan/files/patch-src_tropical2.cpp new file mode 100644 index 000000000000..a22f493f4500 --- /dev/null +++ b/math/gfan/files/patch-src_tropical2.cpp @@ -0,0 +1,88 @@ +--- src/tropical2.cpp.orig 2017-09-28 13:40:06 UTC ++++ src/tropical2.cpp +@@ -287,7 +287,7 @@ PolynomialSet initialForms(PolynomialSet const &groebn + PolyhedralFan tropicalPrincipalIntersection(int n, PolynomialSet const &g, int linealitySpaceDimension) + { + //return tropicalHyperSurfaceIntersection(n, g);//////////////////////////////////////// +- log2 fprintf(Stderr,"Intersecting\n"); ++ gfan_log2 fprintf(Stderr,"Intersecting\n"); + log3 AsciiPrinter(Stderr).printPolynomialSet(g); + + TimerScope ts(&tropicalPrincipalIntersectionTimer); +@@ -297,7 +297,7 @@ PolyhedralFan tropicalPrincipalIntersection(int n, Pol + { + ret=refinement(ret,PolyhedralFan::bergmanOfPrincipalIdeal(*i),linealitySpaceDimension,true); + } +- log2 fprintf(Stderr,"Done intersecting\n"); ++ gfan_log2 fprintf(Stderr,"Done intersecting\n"); + return ret; + } + +@@ -308,12 +308,12 @@ static PolynomialSet checkList(IntegerVectorList const + for(IntegerVectorList::const_iterator i=l.begin();i!=l.end();i++) + { + WeightReverseLexicographicTermOrder t(*i); +- log2 fprintf(Stderr,"Computing Gr\"obner basis with respect to:"); +- log2 AsciiPrinter(Stderr).printVector(*i); +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 fprintf(Stderr,"Computing Gr\"obner basis with respect to:"); ++ gfan_log2 AsciiPrinter(Stderr).printVector(*i); ++ gfan_log2 fprintf(Stderr,"\n"); + PolynomialSet h2=groebnerBasis; + buchberger(&h2,t); +- log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); ++ gfan_log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); + + log3 AsciiPrinter(Stderr).printPolynomialSet(h2); + PolynomialSet wall=initialFormsAssumeMarked(h2,*i); +@@ -459,14 +459,14 @@ PolynomialSet guessInitialIdealWithoutMonomial(Polynom + #endif + + { +- //log2 ++ //gfan_log2 + fprintf(Stderr,"Computing extreme rays.\n"); + //IntegerVectorList a; + PolyhedralCone p=coneFromMarkedBasis(groebnerBasis); + //PolyhedralCone p=PolyhedralCone(wallInequalities(groebnerBasis),a); + IntegerVectorList extreme=p.extremeRays(); +- log2 fprintf(Stderr,"Extreme rays of Groebner cone:\n"); +- log2 AsciiPrinter(Stderr).printVectorList(extreme); ++ gfan_log2 fprintf(Stderr,"Extreme rays of Groebner cone:\n"); ++ gfan_log2 AsciiPrinter(Stderr).printVectorList(extreme); + + bool result; + PolynomialSet r=checkList(extreme,groebnerBasis,fullNeighbourBasis,h,result, onlyCheckRays); +@@ -512,11 +512,11 @@ static PolynomialSet checkListStably(IntegerVectorList + for(IntegerVectorList::const_iterator i=l.begin();i!=l.end();i++) + { + WeightReverseLexicographicTermOrder t(*i); +- log2 fprintf(Stderr,"Taking initial forms with respect to:"); +- log2 AsciiPrinter(Stderr).printVector(*i); +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 fprintf(Stderr,"Taking initial forms with respect to:"); ++ gfan_log2 AsciiPrinter(Stderr).printVector(*i); ++ gfan_log2 fprintf(Stderr,"\n"); + PolynomialSet h2=groebnerBasis; +- log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); ++ gfan_log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); + + log3 AsciiPrinter(Stderr).printPolynomialSet(h2); + PolynomialSet wall=initialForms(h2,*i); +@@ -568,13 +568,13 @@ PolynomialSet guessInitialIdealWithoutMonomialStably(P + } + + { +- log2 fprintf(Stderr,"Computing extreme rays.\n"); ++ gfan_log2 fprintf(Stderr,"Computing extreme rays.\n"); + //IntegerVectorList a; + PolyhedralCone p=coneFromMarkedBasis(groebnerBasis); + //PolyhedralCone p=PolyhedralCone(wallInequalities(groebnerBasis),a); + IntegerVectorList extreme=p.extremeRays(); +- log2 fprintf(Stderr,"Extreme rays of Groebner cone:\n"); +- log2 AsciiPrinter(Stderr).printVectorList(extreme); ++ gfan_log2 fprintf(Stderr,"Extreme rays of Groebner cone:\n"); ++ gfan_log2 AsciiPrinter(Stderr).printVectorList(extreme); + + bool result; + PolynomialSet r=checkListStably(extreme,groebnerBasis,fullNeighbourBasis,h,result, onlyCheckRays); diff --git a/math/gfan/files/patch-src_tropical__weildivisor.cpp b/math/gfan/files/patch-src_tropical__weildivisor.cpp new file mode 100644 index 000000000000..f118a0dfd560 --- /dev/null +++ b/math/gfan/files/patch-src_tropical__weildivisor.cpp @@ -0,0 +1,11 @@ +--- src/tropical_weildivisor.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/tropical_weildivisor.cpp +@@ -53,7 +53,7 @@ PolyhedralFan weilDivisor(PolyhedralFan const &F, Poly + + AsciiPrinter P(Stderr); + +- log2 P<<v<<v<<"\n"; ++ gfan_log2 P<<v<<v<<"\n"; + + int multiplicity=0; + IntegerVector evaluationVector(n); diff --git a/math/gfan/files/patch-src_tropicalbasis.cpp b/math/gfan/files/patch-src_tropicalbasis.cpp new file mode 100644 index 000000000000..1140cde19422 --- /dev/null +++ b/math/gfan/files/patch-src_tropicalbasis.cpp @@ -0,0 +1,112 @@ +--- src/tropicalbasis.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/tropicalbasis.cpp +@@ -118,10 +118,10 @@ PolynomialSet tropicalBasisOfCurve(int n, PolynomialSe + PolynomialSet originalG=g; + // bool prebasis=true; + // debug<<"PREBASIS="<<prebasis<<"\n"; +- log2 debug<<"TropicalBasis begin\n"; +- log2 debug<<g; ++ gfan_log2 debug<<"TropicalBasis begin\n"; ++ gfan_log2 debug<<g; + int homog=linealitySpaceDimension; +- log2 D(linealitySpaceDimension); ++ gfan_log2 D(linealitySpaceDimension); + assert(homog>0 || n==0); + TimerScope ts(&iterativeTropicalBasisTimer); + PolyhedralFan f(n); +@@ -148,7 +148,7 @@ restart: + + if(containsNoMonomialCache.count(relativeInteriorPoint)>0) + { +- log2 fprintf(Stderr,"Weight vector found in cache.... contains no monomial.\n"); ++ gfan_log2 fprintf(Stderr,"Weight vector found in cache.... contains no monomial.\n"); + } + else + { +@@ -163,9 +163,9 @@ restart: + } + }*/ + WeightReverseLexicographicTermOrder t(relativeInteriorPoint); +- log2 fprintf(Stderr,"Computing Gr\"obner basis with respect to:"); +- log2 AsciiPrinter(Stderr).printVector(relativeInteriorPoint); +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 fprintf(Stderr,"Computing Gr\"obner basis with respect to:"); ++ gfan_log2 AsciiPrinter(Stderr).printVector(relativeInteriorPoint); ++ gfan_log2 fprintf(Stderr,"\n"); + PolynomialSet h2=originalG;//g;//<------------------- Using the original set here speeds up things a lot in the starting cone via stable intersections algorithm + // debug<<"g"<<g; + +@@ -178,7 +178,7 @@ restart: + // buchberger(&h2,t); + h2=GE_groebnerBasis(h2,t,true/*autoreduce*/,true/*saturate*/); + // debug<<"h2"<<h2; +- log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); ++ gfan_log2 fprintf(Stderr,"Done computing Gr\"obner basis.\n"); + + // debug<<h2; + // log3 AsciiPrinter(Stderr).printPolynomialSet(h2); +@@ -187,17 +187,17 @@ restart: + + if(containsMonomial(wall)) + { +- log2 fprintf(Stderr,"Initial ideal contains a monomial.\n"); ++ gfan_log2 fprintf(Stderr,"Initial ideal contains a monomial.\n"); + Polynomial m(computeTermInIdeal(wall)); +- log2 fprintf(Stderr,"Done computing term in ideal\n"); ++ gfan_log2 fprintf(Stderr,"Done computing term in ideal\n"); + + // Polynomial temp=m-division(m,h2,LexicographicTermOrder()); + Polynomial temp=m-division(m,h2,t); + g.push_back(temp); + +- log2 fprintf(Stderr,"Adding element to basis:\n"); +- log2 AsciiPrinter(Stderr).printPolynomial(temp); +- log2 fprintf(Stderr,"\n"); ++ gfan_log2 fprintf(Stderr,"Adding element to basis:\n"); ++ gfan_log2 AsciiPrinter(Stderr).printPolynomial(temp); ++ gfan_log2 fprintf(Stderr,"\n"); + + *intersectionFan=refinement(*intersectionFan,PolyhedralFan::bergmanOfPrincipalIdeal(temp),linealitySpaceDimension,true); + break; +@@ -207,7 +207,7 @@ restart: + if(i->dimension()<=1+homog) + //if(!containsMonomial(wall) && i->dimension()<=1+homog)//line for testing perturbation code + { +- log2 fprintf(Stderr,"Initial ideal contains no monomial... caching weight vector.\n"); ++ gfan_log2 fprintf(Stderr,"Initial ideal contains no monomial... caching weight vector.\n"); + containsNoMonomialCache.insert(relativeInteriorPoint); + } + else +@@ -227,10 +227,10 @@ restart: + dual.canonicalize(); + IntegerVectorList basis=dual.getEquations(); + PolynomialSet witnessLiftBasis=h2;//basis with respect to relativeInteriorPoint +- log2 debug<<"basis"<<basis<<"\n"; ++ gfan_log2 debug<<"basis"<<basis<<"\n"; + for(IntegerVectorList::const_iterator j=basis.begin();j!=basis.end();j++) + { +- log2 debug<<"wall"<<wall<<"\n"; ++ gfan_log2 debug<<"wall"<<wall<<"\n"; + WeightReverseLexicographicTermOrder t(*j); + PolynomialSet h3=wall; + // buchberger(&h3,t); +@@ -238,7 +238,7 @@ restart: + wall=initialFormsAssumeMarked(h3,*j); + witnessLiftBasis=liftBasis(h3,witnessLiftBasis); + } +- log2 debug<<"wall"<<wall<<"\n"; ++ gfan_log2 debug<<"wall"<<wall<<"\n"; + if(containsMonomial(wall)) + { + Polynomial m(computeTermInIdeal(wall)); +@@ -259,8 +259,8 @@ restart: + if(i==intersectionFan->conesEnd())break; + } + +- log2 debug<<"TropicalBasis end\n"; +- log2 cerr <<"RETURNING"; ++ gfan_log2 debug<<"TropicalBasis end\n"; ++ gfan_log2 cerr <<"RETURNING"; + return g; + } + diff --git a/math/gfan/files/patch-src_tropicalcurve.cpp b/math/gfan/files/patch-src_tropicalcurve.cpp new file mode 100644 index 000000000000..8d33035139dd --- /dev/null +++ b/math/gfan/files/patch-src_tropicalcurve.cpp @@ -0,0 +1,188 @@ +--- src/tropicalcurve.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/tropicalcurve.cpp +@@ -48,7 +48,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + int stat_isInTropicalVariety=0; + int stat_finiteLiftEasy=0; + int stat_finiteLiftHard=0; +- log2 debug<<"tropicalCurve on:"<<I.getRing()<<I<<"\n"; ++ gfan_log2 debug<<"tropicalCurve on:"<<I.getRing()<<I<<"\n"; + + + +@@ -76,8 +76,8 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + //#if 0 + // for(i=0;i<n;i++) + { +- log2 debug<<"Doing elimination\n"; +- log2 debug<<I<<"\n"; ++ gfan_log2 debug<<"Doing elimination\n"; ++ gfan_log2 debug<<I<<"\n"; + list<int> chosenVariables; + for(int j=0;j<n;j++)if(j!=i)chosenVariables.push_back(j); + +@@ -105,7 +105,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + #endif + + +- log2 debug<<"Done doing elimination\n"; ++ gfan_log2 debug<<"Done doing elimination\n"; + // break; + /* + * At this point we need to be careful with whether we are projecting in the torus or in affine space +@@ -148,14 +148,14 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + for(int s=-1;s<=1;s+=2) + { + IntegerVector v=s*IntegerVector::standardVector(n,i); +- log2 debug<<"Tropical variety membership test of ray:"<<v<<"\n"; ++ gfan_log2 debug<<"Tropical variety membership test of ray:"<<v<<"\n"; + stat_isInTropicalVariety++; + if(isInTropicalVariety(I,v,false)) + { + ret.push_back(s*IntegerVector::standardVector(n,i)); + if(earlyExit)return ret; + } +- log2 debug<<"Done membership test.\n"; ++ gfan_log2 debug<<"Done membership test.\n"; + } + + IntegerVectorList lowerDimList=tropicalCurve(J2,earlyExit); +@@ -175,7 +175,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + + for(IntegerVectorList::const_iterator k=lowerDimList.begin();k!=lowerDimList.end();k++) + { +- log2 debug<<"Doing polyhedral computations1\n"; ++ gfan_log2 debug<<"Doing polyhedral computations1\n"; + #if 1 + IntegerVectorList generators;generators.push_back((concatenation(IntegerVector(1),*k))); + IntegerVectorList lin;lin.push_back((IntegerVector::standardVector(n,i))); +@@ -267,9 +267,9 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + } + }*/ + +- log2 debug<<"Done with polyhedral computations\n"; ++ gfan_log2 debug<<"Done with polyhedral computations\n"; + +- log2 debug<<"Intersection fan dim "<<fanDim<<"\n"; ++ gfan_log2 debug<<"Intersection fan dim "<<fanDim<<"\n"; + + assert(fanDim!=0); + if(fanDim==1) +@@ -281,7 +281,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + if(!j->subvector(1,n).isZero()) + candidates.push_back(*j); + +- log2 debug<<"Number of candidates "<<(int)candidates.size()<<"\n"; ++ gfan_log2 debug<<"Number of candidates "<<(int)candidates.size()<<"\n"; + + if(candidates.size()==1) + { +@@ -303,8 +303,8 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + + + +- log2 debug<<"Checking complicated list:\n"; +- log2 debug<<complicatedList<<"\n"; ++ gfan_log2 debug<<"Checking complicated list:\n"; ++ gfan_log2 debug<<complicatedList<<"\n"; + + PolynomialSet additionalPolys=I.getRing(); + +@@ -314,7 +314,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + for(IntegerVectorList::const_iterator k=complicatedList.begin();k!=complicatedList.end();k++) + supportSum+=k->supportAsZeroOneVector(); + +- log2 debug<<"Support sum:"<<supportSum<<"\n"; ++ gfan_log2 debug<<"Support sum:"<<supportSum<<"\n"; + int j=supportSum.argMax(); + + +@@ -341,18 +341,18 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + + PolynomialRing newRing3=I.getRing().withVariablesAppended("H"); + PolynomialSet J=I.homogenization(newRing3); +- log2 debug<<"Doing elimination\n"; ++ gfan_log2 debug<<"Doing elimination\n"; + buchberger(&J,T,true); + J.changeNumberOfVariables(I.getRing()); + PolynomialRing newRing2(newRing.getField(),2); + PolynomialSet P=J.polynomialRingIntersection(newRing2,&chosenVariables); + #endif + additionalPolys.splice(additionalPolys.end(),J); +- log2 debug<<"Done eliminating\n"; +- log2 debug<<P<<"\n"; ++ gfan_log2 debug<<"Done eliminating\n"; ++ gfan_log2 debug<<P<<"\n"; + assert(P.size()==1); + +- log2 debug<<"Doing polyhedral computation\n"; ++ gfan_log2 debug<<"Doing polyhedral computation\n"; + // debug<<"PFRONT:"<<P.front()<<P.front().exponents()<<"\n"; + // PolyhedralFan FF=PolyhedralFan::normalFanOfNewtonPolytope(P.front()); + PolyhedralFan FF=PolyhedralFan::bergmanOfPrincipalIdeal(P.front()); +@@ -372,14 +372,14 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + F=FF.getRays(); + } + +- log2 debug<<"Potential lifts"<<F<<"\n"; ++ gfan_log2 debug<<"Potential lifts"<<F<<"\n"; + + + for(IntegerVectorList::iterator k=complicatedList.begin();k!=complicatedList.end();) + if((*k)[j]!=0) + { + // debug<<I.getRing()<<"\n"<<I; +- log2 debug<<"Checking:"<<*k<<" with chosen coordinate:"<<j<<"\n"; ++ gfan_log2 debug<<"Checking:"<<*k<<" with chosen coordinate:"<<j<<"\n"; + assert(j!=n); + + IntegerVectorList preCheck; +@@ -396,7 +396,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + IntegerVector v=s1*concatenation(concatenation(k->subvector(0,i),IntegerVector(1)),k->subvector(i,n-1))+s2*(*l)[0]*IntegerVector::standardVector(n,i); + preCheck.push_back(v); + } +- log2 debug<<"Combined:\n"<<preCheck<<"\n"; ++ gfan_log2 debug<<"Combined:\n"<<preCheck<<"\n"; + + IntegerVectorList preCheck2; + for(IntegerVectorList::const_iterator i=preCheck.begin();i!=preCheck.end();i++) +@@ -406,7 +406,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + preCheck2.push_back(*i); + } + +- log2 debug<<"Combined2:\n"<<preCheck2<<"\n"; ++ gfan_log2 debug<<"Combined2:\n"<<preCheck2<<"\n"; + if(preCheck2.size()==1) + ret.splice(ret.end(),preCheck2); + else +@@ -503,7 +503,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + #endif + + +- log2 debug<<"OldtoCheck:"<<toCheck; ++ gfan_log2 debug<<"OldtoCheck:"<<toCheck; + { + IntegerVectorList toCheck2; + for(IntegerVectorList::const_iterator i=toCheck.begin();i!=toCheck.end();i++) +@@ -516,10 +516,10 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + } + + +- log2 debug<<"Checking to check list\n"; ++ gfan_log2 debug<<"Checking to check list\n"; + +- log2 debug<<"Already produced:"<<ret; +- log2 debug<<"toCheck:"<<toCheck; ++ gfan_log2 debug<<"Already produced:"<<ret; ++ gfan_log2 debug<<"toCheck:"<<toCheck; + + for(IntegerVectorList::const_iterator i=toCheck.begin();i!=toCheck.end();i++) + { +@@ -542,7 +542,7 @@ IntegerVectorList tropicalCurve(PolynomialSet const &I + debug<<"*k"<<*k<<"\n"; + //FF.printWithIndices(&debug); + */ +- log2 ++ gfan_log2 + { + debug<<"At dimension "<<n<<"\n"; + debug<<"To Check\n"<<toCheck; diff --git a/math/gfan/files/patch-src_tropicaltraverse.cpp b/math/gfan/files/patch-src_tropicaltraverse.cpp new file mode 100644 index 000000000000..d4a6d4626436 --- /dev/null +++ b/math/gfan/files/patch-src_tropicaltraverse.cpp @@ -0,0 +1,56 @@ +--- src/tropicaltraverse.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/tropicaltraverse.cpp +@@ -199,7 +199,7 @@ static void printMarkedTermIdeal(PolynomialSet const & + static void changeCone(PolynomialSet &coneGroebnerBasis, PolynomialSet &idealGroebnerBasis, IntegerVector const &ridgeVector, IntegerVector const &rayVector) + { + assert(idealGroebnerBasis.containsInClosedGroebnerCone(ridgeVector)); +- log2 cerr<<endl<<"Changing cone"<<endl; ++ gfan_log2 cerr<<endl<<"Changing cone"<<endl; + + assert(!containsMonomial(coneGroebnerBasis)); + +@@ -213,7 +213,7 @@ static void changeCone(PolynomialSet &coneGroebnerBasi + WeightReverseLexicographicTermOrder T(rayVector); + + // P<<ridgeIdeal; +- log2 cerr<<"Computing initial Groebner basis"<<endl; ++ gfan_log2 cerr<<"Computing initial Groebner basis"<<endl; + // buchberger(&ridgeIdeal,T); + + ridgeIdeal=GE_groebnerBasis(ridgeIdeal,T,true,false);//Set to true? +@@ -224,7 +224,7 @@ static void changeCone(PolynomialSet &coneGroebnerBasi + // WeightTermOrder termOrder(termorderWeight(ridgeIdeal)); + WeightTermOrder termOrder(termorderWeight(ridgeIdealOld)); + +- log2 cerr<<"Lifting"<<endl; ++ gfan_log2 cerr<<"Lifting"<<endl; + PolynomialSet temp=ridgeIdealOld; + temp.markAndScale(T); + temp=temp.markedTermIdeal(); +@@ -244,7 +244,7 @@ static void changeCone(PolynomialSet &coneGroebnerBasi + } + assert(g2.isMarked()); + //printMarkedTermIdeal(g2,"g2"); +- log2 cerr<<"Autoreducing"<<endl; ++ gfan_log2 cerr<<"Autoreducing"<<endl; + + // autoReduce(&g2,LexicographicTermOrder()); + //PolynomialSet g2Old=g2; +@@ -260,7 +260,7 @@ static void changeCone(PolynomialSet &coneGroebnerBasi + assert(idealGroebnerBasis.size()==oldSize); + // idealGroebnerBasis=g2; + assert(!containsMonomial(coneGroebnerBasis)); +- log2 cerr<<"Done changing cone"<<endl<<endl; ++ gfan_log2 cerr<<"Done changing cone"<<endl<<endl; + + // P<<coneGroebnerBasis; + // P<<idealGroebnerBasis; +@@ -279,7 +279,7 @@ static void changeCone(PolynomialSet &coneGroebnerBasi + P<<coneGroebnerBasis; + }*/ + +- log2 cerr << "Number of terms in new basis: "<< g2.totalNumberOfTerms()<<endl; ++ gfan_log2 cerr << "Number of terms in new basis: "<< g2.totalNumberOfTerms()<<endl; + } + + void printStack(list<pathStepFacet> const &facetStack, list<pathStepRidge> const &ridgeStack) diff --git a/math/gfan/files/patch-src_wallideal.cpp b/math/gfan/files/patch-src_wallideal.cpp new file mode 100644 index 000000000000..951b31f5b918 --- /dev/null +++ b/math/gfan/files/patch-src_wallideal.cpp @@ -0,0 +1,11 @@ +--- src/wallideal.cpp.orig 2017-06-20 14:47:37 UTC ++++ src/wallideal.cpp +@@ -1055,7 +1055,7 @@ IntegerVectorList fastNormals(IntegerVectorList const + // log0 fprintf(Stderr,"Number of inequalities:%i\n",normals.size()); + + // log0 fprintf(Stderr,"G"); +- //log2 cerr << "Fast normals end" << endl; ++ //gfan_log2 cerr << "Fast normals end" << endl; + return normals; + } + diff --git a/math/gfan/pkg-descr b/math/gfan/pkg-descr index 04b25c5406f0..45bdc80d5452 100644 --- a/math/gfan/pkg-descr +++ b/math/gfan/pkg-descr @@ -1,17 +1,4 @@ Gfan is a software package for computing Groebner fans and tropical -varieties. These are polyhedral fans associated to polynomial ideals. -The maximal cones of a Groebner fan are in bijection with the marked -reduced Groebner bases of its defining ideal. The software computes -all marked reduced Groebner bases of an ideal. Their union is a -universal Greobner basis. The tropical variety of a polynomial ideal -is a certain subcomplex of the Groebner fan. Gfan contains algorithms -for computing this complex for general ideals and specialized -algorithms for tropical curves, tropical hypersurfaces and tropical -varieties of prime ideals. In addition to the above core functions -the package contains many tools which are useful in the study of -Groebner bases, initial ideals and tropical geometry. +varieties. -This port provides gfan together with some handy symlinks. The static -library libgfan.a is provided by the port math/gfanlib. - -WWW: http://home.math.au.dk/jensen/software/gfan/gfan.html +WWW: https://users-math.au.dk/jensen/software/gfan/gfan.html diff --git a/math/gfan/pkg-message b/math/gfan/pkg-message deleted file mode 100644 index d986d1b122a7..000000000000 --- a/math/gfan/pkg-message +++ /dev/null @@ -1,16 +0,0 @@ -[ -{ type: install - message: <<EOM -Gfan can also be linked to Sage, Singular or Soplex. I refrain to -include those optional dependencies because Sage and Singular support -is not documented in gfan's manual and Soplex has a very restrictive -license (you can use or distribute it only if you are a member of a -noncommercial and academic institution). - -If you feel you need any of those optional dependencies, please let -me know and I will do my best to provide it as fast as possible. - -The mantainer. -EOM -} -] diff --git a/math/gfan/pkg-plist b/math/gfan/pkg-plist index eaedc0ba38f0..aa1468e6b2d4 100644 --- a/math/gfan/pkg-plist +++ b/math/gfan/pkg-plist @@ -1,3 +1,40 @@ +%%PORTDOCS%%%%DOCSDIR%%/gfan.eps +%%PORTDOCS%%%%DOCSDIR%%/manual.dvi +%%PORTDOCS%%%%DOCSDIR%%/nonconst.eps +%%PORTDOCS%%%%DOCSDIR%%/polyformat.eps +%%PORTDOCS%%%%DOCSDIR%%/staircase.eps +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of2x3 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of2x4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of3x3 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of4x4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x5.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of4x4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of4x4sym.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/4x4of4x5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/4x4of5x5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/6x6-subPfaffians +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commat2x2 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commat2x2.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cyclic4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cyclic5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examplePaper +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_5.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_6 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_6.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann3_6 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann3_6.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x4 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x4.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x5 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x5.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/linhyper5_2 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/linhyper5_2.cone +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pablo +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sturmfels3.9 +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/symmetryTest bin/gfan bin/gfan_bases bin/gfan_buchberger @@ -53,40 +90,3 @@ bin/gfan_tropicalstartingcone bin/gfan_tropicaltraverse bin/gfan_tropicalweildivisor bin/gfan_version -%%PORTDOCS%%%%DOCSDIR%%/manual.dvi -%%PORTDOCS%%%%DOCSDIR%%/gfan.eps -%%PORTDOCS%%%%DOCSDIR%%/nonconst.eps -%%PORTDOCS%%%%DOCSDIR%%/polyformat.eps -%%PORTDOCS%%%%DOCSDIR%%/staircase.eps -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of2x3 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of2x4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of3x3 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/2x2of4x4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of3x5.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of4x4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/3x3of4x4sym.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/4x4of4x5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/4x4of5x5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/6x6-subPfaffians -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commat2x2 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/commat2x2.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cyclic4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/cyclic5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/examplePaper -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_5.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_6 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann2_6.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann3_6 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/grassmann3_6.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x4 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x4.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x5 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/hankel3x3of4x5.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/linhyper5_2 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/linhyper5_2.cone -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/pablo -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/sturmfels3.9 -%%PORTEXAMPLES%%%%EXAMPLESDIR%%/symmetryTest |