From 6e7fbc025b89997ae663bda0696eca80a6d3f93b Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Fri, 24 Aug 2012 04:14:54 +0200 Subject: [PATCH] Cosmetics. --- mtp_graph.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mtp_graph.cc b/mtp_graph.cc index 8160211..a60e532 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -33,7 +33,7 @@ public: // These are the links in the origin_vertex leaving edge list Edge *next_leaving_edge, *pred_leaving_edge; - inline void revert(); + inline void invert(); }; class Vertex { @@ -52,7 +52,7 @@ public: ////////////////////////////////////////////////////////////////////// -void Edge::revert() { +void Edge::invert() { length = - length; positivized_length = 0; origin_vertex->del_edge(this); @@ -142,6 +142,7 @@ void MTPGraph::print(ostream *os) { void MTPGraph::print_dot(ostream *os) { (*os) << "digraph {" << endl; // (*os) << " node [shape=circle];" << endl; + (*os) << " edge [color=gray]" << endl; (*os) << " " << _source->id << " [peripheries=2];" << endl; (*os) << " " << _sink->id << " [peripheries=2];" << endl; for(int k = 0; k < _nb_edges; k++) { @@ -154,7 +155,7 @@ void MTPGraph::print_dot(ostream *os) { << " [style=bold,color=black,label=\"" << e->length << "\"];" << endl; } else { (*os) << " " << e->origin_vertex->id << " -> " << e->terminal_vertex->id - << " [color=gray,label=\"" << e->length << "\"];" << endl; + << " [label=\"" << e->length << "\"];" << endl; } } (*os) << "}" << endl; @@ -300,7 +301,7 @@ void MTPGraph::find_best_paths(scalar_t *lengths) { while(v->best_pred_edge_to_source) { e = v->best_pred_edge_to_source; v = e->origin_vertex; - e->revert(); + e->invert(); // This is the only place where we change the occupations of // edges e->occupied = 1 - e->occupied; @@ -312,7 +313,7 @@ void MTPGraph::find_best_paths(scalar_t *lengths) { for(int k = 0; k < _nb_edges; k++) { Edge *e = _edges + k; - if(e->occupied) { e->revert(); } + if(e->occupied) { e->invert(); } } } -- 2.39.5