COIN-OR::LEMON - Graph Library

Changeset 367:825647d4eca7 in lemon-0.x


Ignore:
Timestamp:
04/21/04 21:52:09 (16 years ago)
Author:
Mihaly Barasz
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@495
Message:

Remove function and some todos.

Location:
src/work/klao
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/work/klao/iter_map.h

    r365 r367  
    1515namespace hugo {
    1616
     17  /// \brief A map with "small integers" as value set which can enumarate it
     18  /// value classes
    1719
    1820  /// \todo Decide whether we need all the range checkings!!!
     21
     22  /// \todo Implement dynamic map behaviour. Is it necessary? Yes it is.
    1923
    2024  template<typename KeyIntMap, uint8_t N, typename Val = uint8_t>
     
    8589      size_t a = base[k];
    8690      if(a < bounds[N-1]) {
    87         base.set(k, move(a, find(a), n));
     91        move(a, find(a), n);
    8892      }
    8993      else {
     
    9599      data.push_back(k);
    96100      base.set(k, move(bounds[N-1]++, N-1, n));
     101    }
     102
     103    /// This func is not very usable, but necessary to implement
     104    /// dynamic map behaviour.
     105    void remove(const KeyType& k) {
     106      size_t a = base[k];
     107      if(a < bounds[N-1]) {
     108        move(a, find(a), N);
     109        data.pop_back();
     110        base.set(k, -1);
     111      }
    97112    }
    98113
  • src/work/klao/iter_map_test.cc

    r366 r367  
    226226    }
    227227    cout << endl;
     228
     229    cout << "Removing 10 from the map...\n";
     230    test.remove(10);
     231    print(test,2);
    228232  }
    229233}
Note: See TracChangeset for help on using the changeset viewer.