From: Francois Fleuret Date: Thu, 6 Sep 2012 08:27:14 +0000 (+0200) Subject: Cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa06c8a9f47351526c626703be5c75591a499f76;p=mtp.git Cosmetics. --- diff --git a/mtp_graph.cc b/mtp_graph.cc index d3c3c12..2dd145d 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -189,15 +189,14 @@ void MTPGraph::force_positivized_lengths() { scalar_t residual_error = 0.0; scalar_t max_error = 0.0; #endif - for(int n = 0; n < _nb_vertices; n++) { - for(Edge *e = _vertices[n].leaving_edges; e; e = e->next_leaving_edge) { - if(e->positivized_length < 0) { + for(int k = 0; k < _nb_edges; k++) { + Edge *e = _edges + k; + if(e->positivized_length < 0) { #ifdef VERBOSE - residual_error -= e->positivized_length; - max_error = max(max_error, - e->positivized_length); + residual_error -= e->positivized_length; + max_error = max(max_error, - e->positivized_length); #endif - e->positivized_length = 0.0; - } + e->positivized_length = 0.0; } } #ifdef VERBOSE diff --git a/mtp_graph.h b/mtp_graph.h index 945f387..9093a8b 100644 --- a/mtp_graph.h +++ b/mtp_graph.h @@ -40,7 +40,7 @@ class MTPGraph { void update_positivized_lengths(); void force_positivized_lengths(); // Set the edge pred_edge_toward_source correspondingly to the path - // of shortest length. + // of shortest length. The current implementation is not Dijkstra's! void find_shortest_path(); // Follows the path starting on edge e and returns its length. If // nodes is non-null, stores in it the nodes met along the path.