Changeset 675 for GTP/trunk/Lib/Vis/shared/EvalStats
- Timestamp:
- 03/06/06 09:17:09 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/shared/EvalStats/EvalStats.cpp
r670 r675 38 38 39 39 int currentTag = NO_TAG; 40 40 41 41 while (!(getline(file, buf)).eof()) 42 42 { … … 106 106 //<< "#TotalRenderCostGain\n" << 100.0f - costRatio * 100.0f << endl 107 107 //<< "#AvgRenderCostGain\n" << 100.0f - avgCostRatio * 100.0f << endl << endl; 108 << "#TotalRenderCostGain\n" << 100.0f * costRatio - 100.0f<< endl 109 << "#AvgRenderCostGain\n" << 100.0f * avgCostRatio -100.0f << endl << endl; 110 } 111 108 << "#TotalRenderCostRatio\n" << costRatio << endl 109 << "#AvgRenderCostRatio\n" << avgCostRatio << endl << endl; 110 } 111 112 113 int ComputeNoViewCells(const StatsContainer &firstStats, 114 const StatsContainer ¤tStats) 115 { 116 const int n = min((int)firstStats.size(), (int)currentStats.size()); 117 118 const float renderCost = (int)currentStats[n - 1].mRenderCost; 119 120 int i = 0; 121 while ((i ++ < (int)firstStats.size()) && (renderCost > (int)firstStats[i].mRenderCost)); 122 123 return i; 124 } 112 125 113 126 … … 129 142 StatsContainer currentStats; 130 143 131 ifstream file(argv[i]); 144 ifstream file; 145 file.open(argv[i]); 132 146 133 147 // extract the render cost 134 148 cout << "extracting render cost of file " << argv[i] << endl; 135 cout.flush(); 136 137 extractRenderStats(file, currentStats); 138 renderStats.push_back(currentStats); 139 140 // create output file name 141 string fn = argv[i]; 142 143 string::size_type pos = fn.find(".log", 0); 144 fn.erase(pos, 4); 145 //sscanf(argv[i], "%s.log", fn); 146 string outFilename = string(fn) + string("-ratio.log"); 147 148 outFilenames.push_back(outFilename); 149 150 if (extractRenderStats(file, currentStats)) 151 { 152 renderStats.push_back(currentStats); 153 154 // create output file name 155 string fn = argv[i]; 156 157 string::size_type pos = fn.find(".log", 0); 158 fn.erase(pos, 4); 159 //sscanf(argv[i], "%s.log", fn); 160 string outFilename = string(fn) + string("-ratio.log"); 161 162 outFilenames.push_back(outFilename); 163 } 164 else 165 { 166 cout << "could not open file!" << endl; 167 } 149 168 } 150 169 … … 159 178 160 179 // don't compare with itself 161 ++ it;162 ++ sit;180 //++ it; 181 //++ sit; 163 182 164 183 for (it; it != it_end; ++ it) 165 184 { 166 cout << " writing output to file " << *sit << endl;167 ofstream statsOut ((*sit).c_str());168 ++ sit;185 cout << "now writing output to file " << *sit << endl; 186 ofstream statsOut; 187 statsOut.open((*sit).c_str()); 169 188 170 189 // compute size of output vector … … 176 195 } 177 196 197 int vc = ComputeNoViewCells(firstStats, *it); 198 cout << "need " << vc << " view cells to reach rendercost of method " << i << " with " << n << " view cells" << endl; 199 178 200 statsOut.close(); 201 202 ++ sit; 179 203 } 180 204
Note: See TracChangeset
for help on using the changeset viewer.