lemon/matrix_maps.h
changeset 2373 134639e6ea45
parent 2260 4274224f8a7d
child 2376 0ed45a6c74b1
equal deleted inserted replaced
12:6a15b8db70fd 13:2954296b66ba
   352       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
   352       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
   353 	values.resize(size(Parent::getNotifier()->id(key) + 1));	
   353 	values.resize(size(Parent::getNotifier()->id(key) + 1));	
   354       }
   354       }
   355     }
   355     }
   356 
   356 
       
   357     virtual void add(const std::vector<Key>& keys) {
       
   358       int new_size = 0;
       
   359       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);	
       
   362         }
       
   363       }
       
   364       if (new_size > (int)values.size()) {
       
   365         values.resize(new_size);
       
   366       }
       
   367     }
       
   368 
   357     virtual void erase(const Key&) {}
   369     virtual void erase(const Key&) {}
       
   370 
       
   371     virtual void erase(const std::vector<Key>&) {}
   358 
   372 
   359     virtual void build() {
   373     virtual void build() {
   360       values.resize(size(Parent::getNotifier()->maxId() + 1));
   374       values.resize(size(Parent::getNotifier()->maxId() + 1));
   361     }
   375     }
   362 
   376 
   493       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
   507       if (size(Parent::getNotifier()->id(key) + 1) >= (int)values.size()) {
   494 	values.resize(size(Parent::getNotifier()->id(key) + 1));	
   508 	values.resize(size(Parent::getNotifier()->id(key) + 1));	
   495       }
   509       }
   496     }
   510     }
   497 
   511 
       
   512     virtual void add(const std::vector<Key>& keys) {
       
   513       int new_size = 0;
       
   514       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);	
       
   517         }
       
   518       }
       
   519       if (new_size > (int)values.size()) {
       
   520         values.resize(new_size);
       
   521       }
       
   522     }
       
   523 
   498     virtual void erase(const Key&) {}
   524     virtual void erase(const Key&) {}
       
   525 
       
   526     virtual void erase(const std::vector<Key>&) {}
   499 
   527 
   500     virtual void build() {
   528     virtual void build() {
   501       values.resize(size(Parent::getNotifier()->maxId() + 1));
   529       values.resize(size(Parent::getNotifier()->maxId() + 1));
   502     }
   530     }
   503 
   531