From 32139a0f7307a4a4b209e43d44abbed6cdc00c89 Mon Sep 17 00:00:00 2001 From: Francois Fleuret Date: Wed, 5 Sep 2012 18:18:02 +0200 Subject: [PATCH] Cosmetics (in particular allowed_motion -> allowed_motions). --- mtp_example.cc | 5 +++-- mtp_graph.cc | 3 +-- mtp_tracker.cc | 18 +++++++++--------- mtp_tracker.h | 6 +----- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/mtp_example.cc b/mtp_example.cc index 2d6489e..e4df5df 100644 --- a/mtp_example.cc +++ b/mtp_example.cc @@ -24,6 +24,7 @@ #include #include +#include using namespace std; @@ -56,12 +57,12 @@ int main(int argc, char **argv) { // any location less than motion_amplitude away, entrance at // location 0 (or in the first time frame, i.e. targets can already // be in the scene when the sequence starts) and exit at location - // nb_locations-1 (or from the last time frame, i.e. target can + // nb_locations-1 (or from the last time frame, i.e. targets can // still be present when the sequence finishes) for(int l = 0; l < nb_locations; l++) { for(int m = 0; m < nb_locations; m++) { - tracker->allowed_motion[l][m] = abs(l - m) <= motion_amplitude; + tracker->allowed_motions[l][m] = abs(l - m) <= motion_amplitude; } } diff --git a/mtp_graph.cc b/mtp_graph.cc index 052de17..d3c3c12 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -24,9 +24,8 @@ #include "mtp_graph.h" -#include +// #include #include -#include using namespace std; diff --git a/mtp_tracker.cc b/mtp_tracker.cc index b91a000..02541a6 100644 --- a/mtp_tracker.cc +++ b/mtp_tracker.cc @@ -32,7 +32,7 @@ void MTPTracker::free() { delete[] _edge_lengths; delete _graph; deallocate_array(detection_scores); - deallocate_array(allowed_motion); + deallocate_array(allowed_motions); deallocate_array(exits); deallocate_array(entrances); } @@ -44,14 +44,14 @@ void MTPTracker::allocate(int t, int l) { nb_time_steps = t; detection_scores = allocate_array(nb_time_steps, nb_locations); - allowed_motion = allocate_array(nb_locations, nb_locations); + allowed_motions = allocate_array(nb_locations, nb_locations); entrances = allocate_array(nb_time_steps, nb_locations); exits = allocate_array(nb_time_steps, nb_locations); for(int l = 0; l < nb_locations; l++) { for(int m = 0; m < nb_locations; m++) { - allowed_motion[l][m] = 0; + allowed_motions[l][m] = 0; } } @@ -74,7 +74,7 @@ void MTPTracker::write(ostream *os) { for(int l = 0; l < nb_locations; l++) { for(int m = 0; m < nb_locations; m++) { - (*os) << allowed_motion[l][m]; + (*os) << allowed_motions[l][m]; if(m < nb_locations - 1) (*os) << " "; else (*os) << endl; } } @@ -116,7 +116,7 @@ void MTPTracker::read(istream *is) { for(int l = 0; l < nb_locations; l++) { for(int m = 0; m < nb_locations; m++) { - (*is) >> allowed_motion[l][m]; + (*is) >> allowed_motions[l][m]; } } @@ -158,7 +158,7 @@ MTPTracker::MTPTracker() { nb_time_steps = 0; detection_scores = 0; - allowed_motion = 0; + allowed_motions = 0; entrances = 0; exits = 0; @@ -171,7 +171,7 @@ MTPTracker::~MTPTracker() { delete[] _edge_lengths; delete _graph; deallocate_array(detection_scores); - deallocate_array(allowed_motion); + deallocate_array(allowed_motions); deallocate_array(entrances); deallocate_array(exits); } @@ -197,7 +197,7 @@ void MTPTracker::build_graph() { if(entrances[t][l]) nb_entrances++; } for(int m = 0; m < nb_locations; m++) { - if(allowed_motion[l][m]) nb_motions++; + if(allowed_motions[l][m]) nb_motions++; } } @@ -237,7 +237,7 @@ void MTPTracker::build_graph() { for(int t = 0; t < nb_time_steps - 1; t++) { for(int l = 0; l < nb_locations; l++) { for(int k = 0; k < nb_locations; k++) { - if(allowed_motion[l][k]) { + if(allowed_motions[l][k]) { node_from[e] = late_pair_node(t, l); node_to[e] = early_pair_node(t+1, k); _edge_lengths[e] = 0.0; diff --git a/mtp_tracker.h b/mtp_tracker.h index 01c831b..e412482 100644 --- a/mtp_tracker.h +++ b/mtp_tracker.h @@ -33,10 +33,6 @@ using namespace std; #include "mtp_graph.h" class MTPTracker { - scalar_t **_detection_score; - int **_allowed_motion; - int *_entrances, *_exits; - MTPGraph *_graph; scalar_t *_edge_lengths; @@ -47,7 +43,7 @@ public: // The spatial structure int nb_locations, nb_time_steps; - int **allowed_motion; + int **allowed_motions; int **entrances, **exits; // The detection scores at each location and time -- 2.39.5