projects
/
mtp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5b2943d
)
Cosmetics.
author
Francois Fleuret
<francois@fleuret.org>
Thu, 23 Aug 2012 15:07:36 +0000
(08:07 -0700)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 23 Aug 2012 15:07:36 +0000
(08:07 -0700)
tracker.cc
patch
|
blob
|
history
diff --git
a/tracker.cc
b/tracker.cc
index
37fbfe2
..
0e6ed6a
100644
(file)
--- a/
tracker.cc
+++ b/
tracker.cc
@@
-25,8
+25,10
@@
using namespace std;
Tracker::Tracker(int nb_time_steps, int nb_locations) {
_nb_locations = nb_locations;
_nb_time_steps = nb_time_steps;
Tracker::Tracker(int nb_time_steps, int nb_locations) {
_nb_locations = nb_locations;
_nb_time_steps = nb_time_steps;
+
_detection_score = allocate_array<scalar_t>(_nb_time_steps, _nb_locations);
_allowed_motion = allocate_array<int>(_nb_locations, _nb_locations);
_detection_score = allocate_array<scalar_t>(_nb_time_steps, _nb_locations);
_allowed_motion = allocate_array<int>(_nb_locations, _nb_locations);
+
_entrances = new int[_nb_locations];
_exits = new int[_nb_locations];
_entrances = new int[_nb_locations];
_exits = new int[_nb_locations];
@@
-38,6
+40,12
@@
Tracker::Tracker(int nb_time_steps, int nb_locations) {
}
}
}
}
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ _detection_score[t][l] = 0.0;
+ }
+ }
+
_edge_lengths = 0;
_graph = 0;
}
_edge_lengths = 0;
_graph = 0;
}
@@
-52,18
+60,24
@@
Tracker::~Tracker() {
}
void Tracker::set_allowed_motion(int from_location, int to_location, int v) {
}
void Tracker::set_allowed_motion(int from_location, int to_location, int v) {
+ ASSERT(from_location >= 0 && from_location < _nb_locations &&
+ to_location >= 0 && to_location < _nb_locations);
_allowed_motion[from_location][to_location] = v;
}
void Tracker::set_as_entrance(int location, int v) {
_allowed_motion[from_location][to_location] = v;
}
void Tracker::set_as_entrance(int location, int v) {
+ ASSERT(location >= 0 && location < _nb_locations);
_entrances[location] = v;
}
void Tracker::set_as_exit(int location, int v) {
_entrances[location] = v;
}
void Tracker::set_as_exit(int location, int v) {
+ ASSERT(location >= 0 && location < _nb_locations);
_exits[location] = v;
}
void Tracker::set_detection_score(int time, int location, scalar_t score) {
_exits[location] = v;
}
void Tracker::set_detection_score(int time, int location, scalar_t score) {
+ ASSERT(time >= 0 && time < _nb_time_steps &&
+ location >= 0 && location < _nb_locations);
_detection_score[time][location] = score;
}
_detection_score[time][location] = score;
}
@@
-107,7
+121,6
@@
void Tracker::build_graph() {
}
}
}
}
- // We put the other edges after
for(int l = 0; l < _nb_locations; l++) {
node_from[e] = source;
node_to[e] = 1 + l + 0 * _nb_locations;
for(int l = 0; l < _nb_locations; l++) {
node_from[e] = source;
node_to[e] = 1 + l + 0 * _nb_locations;
@@
-161,6
+174,12
@@
void Tracker::build_graph() {
}
void Tracker::print_dot_graph(ostream *os) {
}
void Tracker::print_dot_graph(ostream *os) {
+ int e = 0;
+ for(int t = 0; t < _nb_time_steps; t++) {
+ for(int l = 0; l < _nb_locations; l++) {
+ _edge_lengths[e++] = - _detection_score[t][l];
+ }
+ }
_graph->print_dot(os);
}
_graph->print_dot(os);
}