Ignore:
Timestamp:
04/26/06 14:59:00 (18 years ago)
Author:
mattausch
Message:

created library from the preprocessor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/shared/EvalStats/EvalStats.cpp

    r744 r827  
    191191 
    192192 
     193 
     194 
     195 
     196// evaluate number of view cells needed for same rendercost 
     197int EvalSingleNumViewCells(const StatsContainer &currentStats, 
     198                                                   const float cost) 
     199{ 
     200         
     201        StatsContainer::const_iterator it, it_end = currentStats.end(); 
     202 
     203        RenderStats dummy; dummy.mRenderCost = cost; 
     204         
     205        // find equivalent render cost in the other stats container. 
     206        // don't stop until cursor is placed one element behind 
     207        // or end of vector is reached 
     208        StatsContainer::const_iterator equalCostIt = std::upper_bound(currentStats.begin(),currentStats.end(), dummy, vlt); 
     209 
     210        int j = (int)(equalCostIt - currentStats.begin()); 
     211 
     212        return j; 
     213} 
     214 
     215 
     216 
    193217int _tmain(int argc, _TCHAR* argv[]) 
    194218{ 
     
    203227        vector<string> outFilenames; 
    204228        vector<string> outFilenames2; 
    205  
     229        vector<string> methodnames; 
    206230        // read input files from command line 
    207231        for (int i = 1; i < argc; ++ i) 
     
    227251                        string outFilename = string(fn) + string("-ratio.log"); 
    228252                        string outFilename2 = string(fn) + string("-reverse.log"); 
    229  
     253                         
    230254                        outFilenames.push_back(outFilename); 
    231255                        outFilenames2.push_back(outFilename2); 
     256                        methodnames.push_back(fn); 
     257 
    232258                        cout << "new filen: " << outFilename2 << endl; 
    233259                } 
     
    243269        vector<string>::const_iterator sit, sit_end = outFilenames.end(); 
    244270        vector<string>::const_iterator sit2, sit2_end = outFilenames2.end(); 
     271        vector<string>::const_iterator sit3, sit3_end = methodnames.end(); 
     272 
    245273 
    246274        sit = outFilenames.begin(); 
    247275        sit2 = outFilenames2.begin(); 
     276        sit3 = methodnames.begin(); 
    248277 
    249278        // compare all values with this vector 
     
    253282        //++ it; 
    254283        //++ sit; 
    255  
    256         for (it; it != it_end; ++ it, ++ sit, ++ sit2) 
     284        ofstream statsOut3; 
     285        statsOut3.open("numviewcells.log"); 
     286 
     287        for (it; it != it_end; ++ it, ++ sit, ++ sit2, ++sit3) 
    257288        { 
    258289                cout << "now writing output to file " << *sit << endl; 
     290 
    259291                ofstream statsOut; 
    260292                statsOut.open((*sit).c_str()); 
     293         
    261294                ofstream statsOut2; 
    262295                statsOut2.open((*sit2).c_str()); 
     
    275308                EvalNumViewCells(statsOut2, firstStats, (*it)); 
    276309 
     310                const float rendercost = 100; 
     311                const int j = EvalSingleNumViewCells(*it, rendercost); 
     312 
     313                statsOut3 << (*sit3).c_str() << " " << j << endl; 
     314 
    277315                statsOut.close(); 
    278316                statsOut2.close(); 
    279317        } 
    280318 
     319        statsOut3.close(); 
     320 
     321 
     322 
    281323        return 0; 
    282324} 
Note: See TracChangeset for help on using the changeset viewer.