summaryrefslogtreecommitdiff
path: root/math/gfan/files/patch-src_halfopencone.cpp
blob: faa5f5f4ab653a46037d3e3102c1635f0d7091a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
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();