COIN-OR::LEMON - Graph Library

Changeset 2384:805c5a2a36dd in lemon-0.x for lemon/matrix_maps.h


Ignore:
Timestamp:
03/01/07 18:14:24 (17 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@3215
Message:

getNotifier to notifier renaming

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/matrix_maps.h

    r2376 r2384  
    271271    DynamicMatrixMap(const Graph& _graph)
    272272      : values(size(_graph.maxId(Key()) + 1)) {
    273       Parent::attach(_graph.getNotifier(Key()));
     273      Parent::attach(_graph.notifier(Key()));
    274274    }
    275275
     
    280280    DynamicMatrixMap(const Graph& _graph, const Value& _val)
    281281      : values(size(_graph.maxId(Key()) + 1), _val) {
    282       Parent::attach(_graph.getNotifier(Key()));
     282      Parent::attach(_graph.notifier(Key()));
    283283    }
    284284
     
    297297    DynamicMatrixMap& operator=(const CMap& _cmap){
    298298      checkConcept<concepts::ReadMatrixMap<FirstKey, SecondKey, Value>, CMap>();
    299       typename Parent::Notifier* notifier = Parent::getNotifier();
     299      typename Parent::Notifier* notifier = Parent::notifier();
    300300      Key first, second;
    301301      for(notifier->first(first); first != INVALID;
     
    314314    /// Gives back the value assigned to the \c first - \c second ordered pair.
    315315    ConstReference operator()(const Key& first, const Key& second) const {
    316       return values[index(Parent::getNotifier()->id(first),
    317                           Parent::getNotifier()->id(second))];
     316      return values[index(Parent::notifier()->id(first),
     317                          Parent::notifier()->id(second))];
    318318    }
    319319   
     
    323323    /// Gives back the value assigned to the \c first - \c second ordered pair.
    324324    Reference operator()(const Key& first, const Key& second) {
    325       return values[index(Parent::getNotifier()->id(first),
    326                           Parent::getNotifier()->id(second))];
     325      return values[index(Parent::notifier()->id(first),
     326                          Parent::notifier()->id(second))];
    327327    }
    328328
     
    331331    /// Setter function for the matrix map.
    332332    void set(const Key& first, const Key& second, const Value& val) {
    333       values[index(Parent::getNotifier()->id(first),
    334                    Parent::getNotifier()->id(second))] = val;
     333      values[index(Parent::notifier()->id(first),
     334                   Parent::notifier()->id(second))] = val;
    335335    }
    336336
     
    350350
    351351    virtual void add(const Key& key) {
    352       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
    353         values.resize(size(Parent::getNotifier()->id(key) + 1));       
     352      if (size(Parent::notifier()->id(key) + 1) >= (int)values.size()) {
     353        values.resize(size(Parent::notifier()->id(key) + 1));   
    354354      }
    355355    }
     
    358358      int new_size = 0;
    359359      for (int i = 0; i < (int)keys.size(); ++i) {
    360         if (size(Parent::getNotifier()->id(keys[i]) + 1) >= new_size) {
    361           new_size = size(Parent::getNotifier()->id(keys[i]) + 1);     
     360        if (size(Parent::notifier()->id(keys[i]) + 1) >= new_size) {
     361          new_size = size(Parent::notifier()->id(keys[i]) + 1);
    362362        }
    363363      }
     
    372372
    373373    virtual void build() {
    374       values.resize(size(Parent::getNotifier()->maxId() + 1));
     374      values.resize(size(Parent::notifier()->maxId() + 1));
    375375    }
    376376
     
    420420    DynamicSymMatrixMap(const Graph& _graph)
    421421      : values(size(_graph.maxId(Key()) + 1)) {
    422       Parent::attach(_graph.getNotifier(Key()));
     422      Parent::attach(_graph.notifier(Key()));
    423423    }
    424424
     
    429429    DynamicSymMatrixMap(const Graph& _graph, const Value& _val)
    430430      : values(size(_graph.maxId(Key()) + 1), _val) {
    431       Parent::attach(_graph.getNotifier(Key()));
     431      Parent::attach(_graph.notifier(Key()));
    432432    }
    433433
     
    448448    DynamicSymMatrixMap& operator=(const CMap& _cmap){
    449449      checkConcept<concepts::ReadMatrixMap<FirstKey, SecondKey, Value>, CMap>();
    450       typename Parent::Notifier* notifier = Parent::getNotifier();
     450      typename Parent::Notifier* notifier = Parent::notifier();
    451451      Key first, second;
    452452      for(notifier->first(first); first != INVALID;
     
    467467    /// pair.
    468468    ConstReference operator()(const Key& first, const Key& second) const {
    469       return values[index(Parent::getNotifier()->id(first),
    470                           Parent::getNotifier()->id(second))];
     469      return values[index(Parent::notifier()->id(first),
     470                          Parent::notifier()->id(second))];
    471471    }
    472472   
     
    477477    /// pair.
    478478    Reference operator()(const Key& first, const Key& second) {
    479       return values[index(Parent::getNotifier()->id(first),
    480                           Parent::getNotifier()->id(second))];
     479      return values[index(Parent::notifier()->id(first),
     480                          Parent::notifier()->id(second))];
    481481    }
    482482
     
    486486    ///
    487487    void set(const Key& first, const Key& second, const Value& val) {
    488       values[index(Parent::getNotifier()->id(first),
    489                    Parent::getNotifier()->id(second))] = val;
     488      values[index(Parent::notifier()->id(first),
     489                   Parent::notifier()->id(second))] = val;
    490490    }
    491491
     
    505505
    506506    virtual void add(const Key& key) {
    507       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
    508         values.resize(size(Parent::getNotifier()->id(key) + 1));       
     507      if (size(Parent::notifier()->id(key) + 1) >= (int)values.size()) {
     508        values.resize(size(Parent::notifier()->id(key) + 1));   
    509509      }
    510510    }
     
    513513      int new_size = 0;
    514514      for (int i = 0; i < (int)keys.size(); ++i) {
    515         if (size(Parent::getNotifier()->id(keys[i]) + 1) >= new_size) {
    516           new_size = size(Parent::getNotifier()->id(keys[i]) + 1);     
     515        if (size(Parent::notifier()->id(keys[i]) + 1) >= new_size) {
     516          new_size = size(Parent::notifier()->id(keys[i]) + 1);
    517517        }
    518518      }
     
    527527
    528528    virtual void build() {
    529       values.resize(size(Parent::getNotifier()->maxId() + 1));
     529      values.resize(size(Parent::notifier()->maxId() + 1));
    530530    }
    531531
     
    802802        _second_key_proxy(*this)
    803803    {
    804       _first_key_proxy.attach(_firstContainer.getNotifier(FirstKey()));
    805       _second_key_proxy.attach(_secondContainer.getNotifier(SecondKey()));
     804      _first_key_proxy.attach(_firstContainer.notifier(FirstKey()));
     805      _second_key_proxy.attach(_secondContainer.notifier(SecondKey()));
    806806    }
    807807
     
    818818        _second_key_proxy(*this)
    819819    {
    820       _first_key_proxy.attach(_firstContainer.getNotifier(FirstKey()));
    821       _second_key_proxy.attach(_secondContainer.getNotifier(SecondKey()));
     820      _first_key_proxy.attach(_firstContainer.notifier(FirstKey()));
     821      _second_key_proxy.attach(_secondContainer.notifier(SecondKey()));
    822822    }
    823823     
     
    829829      if(_copy._first_key_proxy.attached() &&
    830830         _copy._second_key_proxy.attached()){
    831         _first_key_proxy.attach(*_copy._first_key_proxy.getNotifier());
    832         _second_key_proxy.attach(*_copy._second_key_proxy.getNotifier());
     831        _first_key_proxy.attach(*_copy._first_key_proxy.notifier());
     832        _second_key_proxy.attach(*_copy._second_key_proxy.notifier());
    833833        values = _copy.values;
    834834      }
     
    855855    ///ordered pair.
    856856    Reference operator()(const FirstKey& _first, const SecondKey& _second) {
    857       return values[_first_key_proxy.getNotifier()->id(_first)]
    858         [_second_key_proxy.getNotifier()->id(_second)];
     857      return values[_first_key_proxy.notifier()->id(_first)]
     858        [_second_key_proxy.notifier()->id(_second)];
    859859    }
    860860
     
    866866    ConstReference operator()(const FirstKey& _first,
    867867                              const SecondKey& _second) const {
    868       return values[_first_key_proxy.getNotifier()->id(_first)]
    869         [_second_key_proxy.getNotifier()->id(_second)];
     868      return values[_first_key_proxy.notifier()->id(_first)]
     869        [_second_key_proxy.notifier()->id(_second)];
    870870    }
    871871
     
    875875    void set(const FirstKey& first, const SecondKey& second,
    876876             const Value& value){
    877       values[_first_key_proxy.getNotifier()->id(first)]
    878         [_second_key_proxy.getNotifier()->id(second)] = value;
     877      values[_first_key_proxy.notifier()->id(first)]
     878        [_second_key_proxy.notifier()->id(second)] = value;
    879879    }
    880880
     
    894894      checkConcept<concepts::ReadMatrixMap<FirstKey, SecondKey, Value>, CMap>();
    895895      const typename FirstKeyProxy::Notifier* notifierFirstKey =
    896         _first_key_proxy.getNotifier();
     896        _first_key_proxy.notifier();
    897897      const typename SecondKeyProxy::Notifier* notifierSecondKey =
    898         _second_key_proxy.getNotifier();
     898        _second_key_proxy.notifier();
    899899      FirstKey itemFirst;
    900900      SecondKey itemSecond;
     
    917917    void addFirstKey(const FirstKey& firstKey) {
    918918      int size = (int)values.size();
    919       if( _first_key_proxy.getNotifier()->id(firstKey)+1 >= size ){
    920         values.resize(_first_key_proxy.getNotifier()->id(firstKey)+1);
     919      if( _first_key_proxy.notifier()->id(firstKey)+1 >= size ){
     920        values.resize(_first_key_proxy.notifier()->id(firstKey)+1);
    921921        if( (int)values[0].size() != 0 ){
    922922          int innersize = (int)values[0].size();
     
    924924            (values[i]).resize(innersize);
    925925          }
    926         }else if(_second_key_proxy.getNotifier()->maxId() >= 0){
    927           int innersize = _second_key_proxy.getNotifier()->maxId();
     926        }else if(_second_key_proxy.notifier()->maxId() >= 0){
     927          int innersize = _second_key_proxy.notifier()->maxId();
    928928          for(int i = 0; i != (int)values.size(); ++i){
    929929            values[0].resize(innersize);
     
    940940      int max = values.size() - 1;
    941941      for(int i=0; i != (int)firstKeys.size(); ++i){
    942         int id = _first_key_proxy.getNotifier()->id(firstKeys[i]);
     942        int id = _first_key_proxy.notifier()->id(firstKeys[i]);
    943943        if(max < id){
    944944          max = id;
     
    953953            values[i].resize(innersize);
    954954          }
    955         }else if(_second_key_proxy.getNotifier()->maxId() >= 0){
    956           int innersize = _second_key_proxy.getNotifier()->maxId();
     955        }else if(_second_key_proxy.notifier()->maxId() >= 0){
     956          int innersize = _second_key_proxy.notifier()->maxId();
    957957          for(int i = 0; i != (int)values.size(); ++i){
    958958            values[i].resize(innersize);
     
    970970        return;
    971971      }
    972       int id = _second_key_proxy.getNotifier()->id(secondKey);
     972      int id = _second_key_proxy.notifier()->id(secondKey);
    973973      if(id >= (int)values[0].size()){
    974974        for(int i=0;i!=(int)values.size();++i){
     
    988988      int max = values[0].size();
    989989      for(int i = 0; i != (int)secondKeys.size(); ++i){
    990         int id = _second_key_proxy.getNotifier()->id(secondKeys[i]);
     990        int id = _second_key_proxy.notifier()->id(secondKeys[i]);
    991991        if(max < id){
    992992          max = id;
     
    10051005    ///class belongs to the FirstKey type.
    10061006    void eraseFirstKey(const FirstKey& first) {
    1007       int id = _first_key_proxy.getNotifier()->id(first);
     1007      int id = _first_key_proxy.notifier()->id(first);
    10081008      for(int i = 0; i != (int)values[id].size(); ++i){
    10091009        values[id][i] = Value();
     
    10171017    void eraseFirstKeys(const std::vector<FirstKey>& firstKeys) {
    10181018      for(int j = 0; j != (int)firstKeys.size(); ++j){
    1019         int id = _first_key_proxy.getNotifier()->id(firstKeys[j]);
     1019        int id = _first_key_proxy.notifier()->id(firstKeys[j]);
    10201020        for(int i = 0; i != (int)values[id].size(); ++i){
    10211021          values[id][i] = Value();
     
    10321032        return;
    10331033      }
    1034       int id = _second_key_proxy.getNotifier()->id(second);
     1034      int id = _second_key_proxy.notifier()->id(second);
    10351035      for(int i = 0; i != (int)values.size(); ++i){
    10361036        values[i][id] = Value();
     
    10471047      }
    10481048      for(int j = 0; j != (int)secondKeys.size(); ++j){
    1049         int id = _second_key_proxy.getNotifier()->id(secondKeys[j]);
     1049        int id = _second_key_proxy.notifier()->id(secondKeys[j]);
    10501050        for(int i = 0; i != (int)values.size(); ++i){
    10511051          values[i][id] = Value();
     
    10591059    ///to the FirstKey or SecondKey type.
    10601060    void build() {
    1061       values.resize(_first_key_proxy.getNotifier()->maxId());
     1061      values.resize(_first_key_proxy.notifier()->maxId());
    10621062      for(int i=0; i!=(int)values.size(); ++i){
    1063         values[i].resize(_second_key_proxy.getNotifier()->maxId());
     1063        values[i].resize(_second_key_proxy.notifier()->maxId());
    10641064      }
    10651065    }
Note: See TracChangeset for help on using the changeset viewer.