projects
/
mtp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Initial commit.
[mtp.git]
/
mtp_graph.cc
diff --git
a/mtp_graph.cc
b/mtp_graph.cc
index
052de17
..
2dd145d
100644
(file)
--- a/
mtp_graph.cc
+++ b/
mtp_graph.cc
@@
-24,9
+24,8
@@
#include "mtp_graph.h"
#include "mtp_graph.h"
-#include <iostream>
+
//
#include <iostream>
#include <float.h>
#include <float.h>
-#include <stdlib.h>
using namespace std;
using namespace std;
@@
-190,15
+189,14
@@
void MTPGraph::force_positivized_lengths() {
scalar_t residual_error = 0.0;
scalar_t max_error = 0.0;
#endif
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
#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
#endif
- e->positivized_length = 0.0;
- }
+ e->positivized_length = 0.0;
}
}
#ifdef VERBOSE
}
}
#ifdef VERBOSE