src/hugo/dijkstra.h
changeset 784 a48964a87141
parent 776 f2994a2b10b2
child 785 a9b0863c2265
equal deleted inserted replaced
12:44939c6dd6c6 13:4c499c076a2a
   277     ///v. It is \ref INVALID
   277     ///v. It is \ref INVALID
   278     ///if \c v is unreachable from the root or if \c v=s. The
   278     ///if \c v is unreachable from the root or if \c v=s. The
   279     ///shortest path tree used here is equal to the shortest path tree used in
   279     ///shortest path tree used here is equal to the shortest path tree used in
   280     ///\ref predNode(Node v).  \pre \ref run() must be called before using
   280     ///\ref predNode(Node v).  \pre \ref run() must be called before using
   281     ///this function.
   281     ///this function.
       
   282     ///\todo predEdge could be a better name.
   282     Edge pred(Node v) const { return (*predecessor)[v]; }
   283     Edge pred(Node v) const { return (*predecessor)[v]; }
   283 
   284 
   284     ///Returns the 'previous node' of the shortest path tree.
   285     ///Returns the 'previous node' of the shortest path tree.
   285 
   286 
   286     ///For a node \c v it returns the 'previous node' of the shortest path tree,
   287     ///For a node \c v it returns the 'previous node' of the shortest path tree,
   315 
   316 
   316     ///Returns \c true if \c v is reachable from the root.
   317     ///Returns \c true if \c v is reachable from the root.
   317     ///\warning the root node is reported to be reached!
   318     ///\warning the root node is reported to be reached!
   318     ///\pre \ref run() must be called before using this function.
   319     ///\pre \ref run() must be called before using this function.
   319     ///
   320     ///
   320     bool reached(Node v) { return v==source || (*predecessor)[v]==INVALID; }
   321     bool reached(Node v) { return v==source || (*predecessor)[v]!=INVALID; }
   321     
   322     
   322   };
   323   };
   323   
   324   
   324 
   325 
   325   // **********************************************************************
   326   // **********************************************************************