projects
/
mtp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cosmetics.
[mtp.git]
/
mtp.cc
diff --git
a/mtp.cc
b/mtp.cc
index
f2db0c6
..
62ab56a
100644
(file)
--- a/
mtp.cc
+++ b/
mtp.cc
@@
-32,25
+32,27
@@
int main(int argc, char **argv) {
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
-
Tracker tracker
;
+
ifstream *in_tracker = new ifstream(argv[1])
;
- if
stream in_tracker(argv[1]);
+ if
(in_tracker->good()) {
- if(in_tracker.good()) {
+ Tracker *tracker = new Tracker();
- tracker
.read(&
in_tracker);
- tracker
.
build_graph();
- tracker
.
track();
+ tracker
->read(
in_tracker);
+ tracker
->
build_graph();
+ tracker
->
track();
cout << "Read " << argv[1] << endl;
ofstream out_traj("result.trj");
cout << "Read " << argv[1] << endl;
ofstream out_traj("result.trj");
- tracker
.
write_trajectories(&out_traj);
+ tracker
->
write_trajectories(&out_traj);
cout << "Wrote result.trj" << endl;
ofstream out_dot("graph.dot");
cout << "Wrote result.trj" << endl;
ofstream out_dot("graph.dot");
- tracker
.
print_graph_dot(&out_dot);
+ tracker
->
print_graph_dot(&out_dot);
cout << "Wrote graph.dot" << endl;
cout << "Wrote graph.dot" << endl;
+ delete tracker;
+
} else {
cerr << "Can not open " << argv[1] << endl;
} else {
cerr << "Can not open " << argv[1] << endl;
@@
-58,5
+60,7
@@
int main(int argc, char **argv) {
}
}
+ delete in_tracker;
+
exit(EXIT_SUCCESS);
}
exit(EXIT_SUCCESS);
}