Changeset 2015 for GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
- Timestamp:
- 01/22/07 20:25:06 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.h
r1998 r2015 310 310 bool RequiresResort() const 311 311 { 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 319 328 int GetLastSorted() const 320 329 { … … 600 609 const bool checkDirty) 601 610 { 602 bool found = false;603 604 611 PvsEntry<T, S> dummy(sample, PvsData()); 605 612 … … 611 618 612 619 if ((it != mEntries.end()) && ((*it).mObject == sample)) 613 found = true; 620 // if (it != sorted_end) 621 return true; 614 622 615 623 // sample not found yet => search further in the unsorted part 616 if ( !found &&checkDirty) {624 if (checkDirty) { 617 625 618 626 for (it = sorted_end; (it != mEntries.end()) && ((*it).mObject != sample); ++ it) ; 619 627 620 628 if (it != mEntries.end()) 621 found =true;629 return true; 622 630 } 623 631 624 return f ound;632 return false; 625 633 } 626 634
Note: See TracChangeset
for help on using the changeset viewer.