lemon/bellman_ford.h
changeset 2076 10681ee9d8ae
parent 2070 1287ef6c180f
child 2111 ea1fa1bc3f6d
equal deleted inserted replaced
8:dbc2856308fb 9:f6efb2cc234c
   324     /// \param _graph the graph the algorithm will run on.
   324     /// \param _graph the graph the algorithm will run on.
   325     /// \param _length the length map used by the algorithm.
   325     /// \param _length the length map used by the algorithm.
   326     BellmanFord(const Graph& _graph, const LengthMap& _length) :
   326     BellmanFord(const Graph& _graph, const LengthMap& _length) :
   327       graph(&_graph), length(&_length),
   327       graph(&_graph), length(&_length),
   328       _pred(0), local_pred(false),
   328       _pred(0), local_pred(false),
   329       _dist(0), local_dist(false) {}
   329       _dist(0), local_dist(false), _mask(0) {}
   330     
   330     
   331     ///Destructor.
   331     ///Destructor.
   332     ~BellmanFord() {
   332     ~BellmanFord() {
   333       if(local_pred) delete _pred;
   333       if(local_pred) delete _pred;
   334       if(local_dist) delete _dist;
   334       if(local_dist) delete _dist;
   335       delete _mask;
   335       if(_mask) delete _mask;
   336     }
   336     }
   337 
   337 
   338     /// \brief Sets the length map.
   338     /// \brief Sets the length map.
   339     ///
   339     ///
   340     /// Sets the length map.
   340     /// Sets the length map.