Cosmetics.
[mtp.git] / mtp_graph.cc
index a208403..a60e532 100644 (file)
@@ -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);
@@ -83,17 +83,6 @@ void Vertex::del_edge(Edge *e) {
 
 //////////////////////////////////////////////////////////////////////
 
-Path::Path(int l) {
-  length = l;
-  nodes = new int[length];
-}
-
-Path::~Path() {
-  delete[] nodes;
-}
-
-//////////////////////////////////////////////////////////////////////
-
 MTPGraph::MTPGraph(int nb_vertices, int nb_edges,
                    int *from, int *to,
                    int source, int sink) {
@@ -153,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++) {
@@ -165,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;
@@ -311,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;
@@ -323,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(); }
   }
 }