From: Francois Fleuret Date: Sun, 26 Aug 2012 06:30:42 +0000 (+0200) Subject: Cleaned up comments. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=2c79f2f3d73d7dc7a8c799ad9386484a5a684ca4;p=mtp.git Cleaned up comments. --- diff --git a/mtp_graph.cc b/mtp_graph.cc index 9a811bb..473d13e 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -232,7 +232,7 @@ int MTPGraph::is_dag() { } new_front_size = 0; - // We remove all vertex without incoming edge + // We remove all the vertices without incoming edge for(int f = 0; f < front_size; f++) { v = _front[f]; if(v->iteration == iteration) { @@ -247,8 +247,10 @@ int MTPGraph::is_dag() { return front_size == 0; } -// This method does not change the edge occupation. It update -// distance_from_source and pred_edge_toward_source. +// This method does not change the edge occupation. It only set +// properly for every vertex the fields distance_from_source and +// pred_edge_toward_source. + void MTPGraph::find_shortest_path() { Vertex **tmp_front; int tmp_front_size; @@ -312,8 +314,9 @@ void MTPGraph::find_best_paths(scalar_t *lengths) { // Let's be a bit paranoid ASSERT(is_dag()); - // We use one iteration of find_shortest_path simply to propagate - // the distance to make all the edge lengths positive. + // We use call find_shortest_path here to set properly the distance, + // so that we can make all the edge lengths positive at the first + // iteration. find_shortest_path(); do { @@ -323,7 +326,7 @@ void MTPGraph::find_best_paths(scalar_t *lengths) { total_length = 0.0; - // Do we reach the _sink? + // Do we reach the sink? if(_sink->pred_edge_toward_source) { // If yes, compute the length of the best path v = _sink;