Ignore:
Timestamp:
01/22/07 20:25:06 (17 years ago)
Author:
bittner
Message:

pvs efficiency tuning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h

    r1998 r2015  
    310310        bool RequiresResort() const 
    311311        { 
    312                 // the last part should not be more than log of the sorted part. this 
    313                 // way we can achieve logarithmic behaviour for insertion and find 
    314                 const int dirtySize = (int)mEntries.size() - mLastSorted; 
    315                 return dirtySize > 4*(int)(log((double)mEntries.size()) / log(2.0)); 
    316         } 
    317  
    318  
     312          // the last part should not be more than log of the sorted part. this 
     313          // way we can achieve logarithmic behaviour for insertion and find 
     314          const int dirtySize = (int)mEntries.size() - mLastSorted; 
     315          return dirtySize > 500; 
     316          //              4*(int)(log((double)mEntries.size()) / log(2.0)); 
     317        } 
     318 
     319  bool RequiresResortLog() const 
     320  { 
     321        // the last part should not be more than log of the sorted part. this 
     322        // way we can achieve logarithmic behaviour for insertion and find 
     323        const int dirtySize = (int)mEntries.size() - mLastSorted; 
     324        return dirtySize > 4*(int)(log((double)mEntries.size()) / log(2.0)); 
     325  } 
     326   
     327   
    319328        int GetLastSorted() const 
    320329        { 
     
    600609                                         const bool checkDirty) 
    601610{ 
    602   bool found = false; 
    603    
    604611  PvsEntry<T, S> dummy(sample, PvsData()); 
    605612   
     
    611618   
    612619  if ((it != mEntries.end()) && ((*it).mObject == sample)) 
    613         found = true; 
     620        //  if (it != sorted_end) 
     621        return true; 
    614622   
    615623  // sample not found yet => search further in the unsorted part 
    616   if (!found && checkDirty) { 
     624  if (checkDirty) { 
    617625         
    618626        for (it = sorted_end; (it != mEntries.end()) && ((*it).mObject != sample); ++ it) ; 
    619627         
    620628        if (it != mEntries.end()) 
    621           found = true; 
     629          return true; 
    622630  } 
    623631   
    624   return found; 
     632  return false; 
    625633} 
    626634 
Note: See TracChangeset for help on using the changeset viewer.