Changeset 733


Ignore:
Timestamp:
04/07/06 08:19:29 (18 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r725 r733  
    110110} 
    111111 
    112 #if 0 
    113 void EvalNumViewCells(const int i, 
     112void EvalNumViewCells(ofstream &outstream, 
    114113                                          const StatsContainer &firstStats,  
    115114                                          const StatsContainer &currentStats, 
    116115                                          vector<float> &ratios) 
    117116{ 
    118         const int n = min((int)firstStats.size(), (int)currentStats.size()); 
    119  
     117        //const int n = min((int)firstStats.size(), (int)currentStats.size()); 
     118        const int n = (int)firstStats.size(); 
     119         
    120120        StatsContainer::const_iterator it, it_end = currentStats.end(); 
    121121 
    122122        int i = 0; 
    123123 
     124        // currentStats would be the other (necessarily worse?) method 
     125        // firstStats would be our method 
     126        // compare render cost of current view cell with render cost  
     127        // of other view cells. 
    124128        for (it = currentStats.begin(); it != it_end; ++ it) 
    125129        { 
     130                int j = 0; 
     131 
    126132                const float renderCost = (*it).mRenderCost; 
    127133     
    128                 // find equivalent render cost in second stats container 
    129                 while ((i < n) && (renderCost < (int)firstStats[i ++].mRenderCost)); 
     134                // find equivalent render cost in the other stats container. 
     135                // don't stop until cursor is placed one element behind 
     136                // or end of vector is reached 
     137                while ((j < n) && (renderCost > (int)firstStats[j ++].mRenderCost)); 
    130138         
    131139                // lower bound 
    132                 int j = max (0, i - 1); 
    133         } 
    134  
    135         return i; 
    136 } 
    137 #endif 
     140                //int j = max (0, i - 1); 
     141                float ratio = (float)i / (float)j; 
     142 
     143                outstream << "#RenderCost " << renderCost << endl; 
     144                outstream << "#ViewCellsRatio " << ratio << endl; 
     145 
     146        } 
     147} 
     148 
    138149 
    139150int _tmain(int argc, _TCHAR* argv[]) 
Note: See TracChangeset for help on using the changeset viewer.