lemon/bellman_ford.h
changeset 820 7ef7a5fbb85d
parent 788 c92296660262
child 825 75e6020b19b1
equal deleted inserted replaced
5:5e20df85973b 6:c2c926ea7522
   235       }
   235       }
   236       if(!_dist) {
   236       if(!_dist) {
   237 	_local_dist = true;
   237 	_local_dist = true;
   238 	_dist = Traits::createDistMap(*_gr);
   238 	_dist = Traits::createDistMap(*_gr);
   239       }
   239       }
   240       _mask = new MaskMap(*_gr, false);
   240       if(!_mask) {
       
   241         _mask = new MaskMap(*_gr);
       
   242       }
   241     }
   243     }
   242     
   244     
   243   public :
   245   public :
   244  
   246  
   245     typedef BellmanFord Create;
   247     typedef BellmanFord Create;
   401       _process.clear();
   403       _process.clear();
   402       if (OperationTraits::less(value, OperationTraits::infinity())) {
   404       if (OperationTraits::less(value, OperationTraits::infinity())) {
   403 	for (NodeIt it(*_gr); it != INVALID; ++it) {
   405 	for (NodeIt it(*_gr); it != INVALID; ++it) {
   404 	  _process.push_back(it);
   406 	  _process.push_back(it);
   405 	  _mask->set(it, true);
   407 	  _mask->set(it, true);
       
   408 	}
       
   409       } else {
       
   410 	for (NodeIt it(*_gr); it != INVALID; ++it) {
       
   411 	  _mask->set(it, false);
   406 	}
   412 	}
   407       }
   413       }
   408     }
   414     }
   409     
   415     
   410     /// \brief Adds a new source node.
   416     /// \brief Adds a new source node.