From fa06c8a9f47351526c626703be5c75591a499f76 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Thu, 6 Sep 2012 10:27:14 +0200 Subject: [PATCH] Cosmetics. --- mtp_graph.cc | 13 ++++++------- mtp_graph.h | 2 +- 2 files changed, 7 insertions(+), 8 deletions(-) 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. -- 2.39.5