Cosmetics.
[mtp.git] / mtp_graph.cc
index c2a7fa3..c7e6b98 100644 (file)
@@ -84,15 +84,6 @@ void MTPGraph::print_dot() {
   cout << "}" << endl;
 }
 
-
-void dot_print(int nb_vertices,
-               int nb_edges, int *ea, int *eb, scalar_t *el,
-               int _source, int _sink,
-               int *edge_occupation) {
-  for(int e = 0; e < nb_edges; e++) {
-  }
-  cout << "}" << endl;
-}
 MTPGraph::MTPGraph(int nb_vertices, int nb_edges,
                    int *from, int *to,
                    int src, int snk) {
@@ -101,6 +92,8 @@ MTPGraph::MTPGraph(int nb_vertices, int nb_edges,
 
   edges = new Edge[_nb_edges];
   vertices = new Vertex[_nb_vertices];
+  _front = new Vertex *[_nb_vertices];
+  _new_front = new Vertex *[_nb_vertices];
 
   _source = &vertices[src];
   _sink = &vertices[snk];
@@ -116,8 +109,6 @@ MTPGraph::MTPGraph(int nb_vertices, int nb_edges,
     edges[e].terminal_vertex = &vertices[to[e]];
   }
 
-  _front = new Vertex *[_nb_vertices];
-  _new_front = new Vertex *[_nb_vertices];
 }
 
 MTPGraph::~MTPGraph() {
@@ -141,7 +132,7 @@ void MTPGraph::initialize_work_lengths() {
   }
 }
 
-void MTPGraph::update_work_length() {
+void MTPGraph::update_work_lengths() {
   for(int n = 0; n < _nb_vertices; n++) {
     scalar_t d = vertices[n].distance_from_source;
     for(Edge *e = vertices[n].root_edge; e; e = e->next) {
@@ -228,7 +219,7 @@ void MTPGraph::find_best_paths(scalar_t *lengths, int *result_edge_occupation) {
   do {
     total_length = 0.0;
     find_shortest_path(_front, _new_front);
-    update_work_length();
+    update_work_lengths();
 
     // Do we reach the _sink?
     if(_sink->pred_edge) {