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
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.