CXXFLAGS = -Wall $(OPTIMIZE_FLAG) $(PROFILE_FLAG) $(VERBOSE_FLAG)
-all: mtp mtp_example
+all: mtp mtp_example mtp_stress_test
mtp: \
path.o \
mtp_example.o
$(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
+mtp_stress_test: \
+ path.o \
+ mtp_graph.o \
+ mtp_tracker.o \
+ mtp_stress_test.o
+ $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS)
+
Makefile.depend: *.h *.cc Makefile
$(CC) $(CXXFLAGS) -M *.cc > Makefile.depend
clean:
- \rm -f mtp mtp_example *.o Makefile.depend
+ \rm -f mtp mtp_example mtp_stress_test *.o Makefile.depend
-include Makefile.depend
#endif
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);
+ if((e->origin_vertex->last_change < 0 && e->terminal_vertex->last_change >= 0) ||
+ (e->origin_vertex->last_change >= 0 && e->terminal_vertex->last_change < 0)) {
+ cout << "Inconsistent non-connexity (this should never happen)." << endl;
+ abort();
+ }
+ if(e->origin_vertex->last_change >= 0 &&
+ e->terminal_vertex->last_change >= 0 &&
+ e->positivized_length < 0) {
+ residual_error -= e->positivized_length;
+ max_error = max(max_error, - e->positivized_length);
+ }
#endif
e->positivized_length = 0.0;
}