Changeset 2363


Ignore:
Timestamp:
Dec 5, 2010, 3:34:47 AM (11 years ago)
Author:
Peter
Message:

fixing some leftover errors. refs #640

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/segment_test.cc

    r2362 r2363  
    241241  i = map.lower_bound(0.0);
    242242  i = map.upper_bound(0.0);
    243  
    244243}
    245244
  • trunk/yat/utility/SegmentTree.h

    r2362 r2363  
    274274    iterator result = container_.upper_bound(segment);
    275275    Compare comp;
    276     if (result==end() || comp(element, result->begin()))
     276    Value2Key value2key;
     277    if (result==end() || comp(element, value2key(*result).begin()))
    277278      return result;
    278279    ++result;
    279280    // result is larger than segment
    280     YAT_ASSERT(result==end() || compare(segment, *result));
     281    YAT_ASSERT(result==end() || compare(segment, value2key(*result)));
    281282    return result;
    282283  }
     
    287288  SegmentTree<T, Compare,Value2Key>::upper_bound(const element_type& element) const
    288289  {
    289     Segment<T, Compare> segment(element, element);
     290    Segment<element_type, Compare> segment(element, element);
    290291    const_iterator result = container_.upper_bound(segment);
    291292    Compare comp;
    292     if (result==end() || comp(element, result->begin()))
     293    Value2Key value2key;
     294    if (result==end() || comp(element, value2key(*result).begin()))
    293295      return result;
    294296    ++result;
    295297    // result is larger than segment
    296     YAT_ASSERT(result==end() || compare(segment, *result));
     298    YAT_ASSERT(result==end() || compare(segment, value2key(*result)));
    297299    return result;
    298300  }
Note: See TracChangeset for help on using the changeset viewer.