From: Francois Fleuret Date: Fri, 24 Aug 2012 00:18:46 +0000 (-0700) Subject: Cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=c8a37f33eb29f651fed648a48918390f0da1eefb;p=mtp.git Cosmetics. --- diff --git a/Makefile b/Makefile index adcff72..2264c56 100644 --- a/Makefile +++ b/Makefile @@ -45,7 +45,7 @@ random-graph: \ $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) mtp: \ - mtp_graph.o \ + path.o mtp_graph.o \ tracker.o \ mtp.o $(CXX) $(CXXFLAGS) -o $@ $^ $(LDFLAGS) diff --git a/misc.h b/misc.h index f9458da..51ad326 100644 --- a/misc.h +++ b/misc.h @@ -1,12 +1,20 @@ -//////////////////////////////////////////////////////////////////// -// START_IP_HEADER // -// // -// Written by Francois Fleuret // -// Contact for comments & bug reports // -// // -// END_IP_HEADER // -//////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the version 3 of the GNU General Public License // +// as published by the Free Software Foundation. // +// // +// This program is distributed in the hope that it will be useful, but // +// WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // +// General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +// // +// Written by and Copyright (C) Francois Fleuret // +// Contact for comments & bug reports // +/////////////////////////////////////////////////////////////////////////// #ifndef MISC_H #define MISC_H diff --git a/mtp_graph.cc b/mtp_graph.cc index a208403..8160211 100644 --- a/mtp_graph.cc +++ b/mtp_graph.cc @@ -83,17 +83,6 @@ void Vertex::del_edge(Edge *e) { ////////////////////////////////////////////////////////////////////// -Path::Path(int l) { - length = l; - nodes = new int[length]; -} - -Path::~Path() { - delete[] nodes; -} - -////////////////////////////////////////////////////////////////////// - MTPGraph::MTPGraph(int nb_vertices, int nb_edges, int *from, int *to, int source, int sink) { diff --git a/mtp_graph.h b/mtp_graph.h index 0fad09d..7ccbfe3 100644 --- a/mtp_graph.h +++ b/mtp_graph.h @@ -25,18 +25,11 @@ using namespace std; #include "misc.h" +#include "path.h" class Vertex; class Edge; -class Path { -public: - Path(int l); - ~Path(); - int length; - int *nodes; -}; - class MTPGraph { void initialize_positivized_lengths_with_min(); void update_positivized_lengths(); @@ -54,6 +47,7 @@ class MTPGraph { public: + // These variables are filled when retrieve_disjoint_paths is called int nb_paths; Path **paths; diff --git a/path.cc b/path.cc new file mode 100644 index 0000000..d38b88b --- /dev/null +++ b/path.cc @@ -0,0 +1,30 @@ + +/////////////////////////////////////////////////////////////////////////// +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the version 3 of the GNU General Public License // +// as published by the Free Software Foundation. // +// // +// This program is distributed in the hope that it will be useful, but // +// WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // +// General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +// // +// Written by and Copyright (C) Francois Fleuret // +// Contact for comments & bug reports // +/////////////////////////////////////////////////////////////////////////// + +#include "path.h" + +////////////////////////////////////////////////////////////////////// + +Path::Path(int l) { + length = l; + nodes = new int[length]; +} + +Path::~Path() { + delete[] nodes; +} diff --git a/path.h b/path.h new file mode 100644 index 0000000..11711a3 --- /dev/null +++ b/path.h @@ -0,0 +1,30 @@ + +/////////////////////////////////////////////////////////////////////////// +// This program is free software: you can redistribute it and/or modify // +// it under the terms of the version 3 of the GNU General Public License // +// as published by the Free Software Foundation. // +// // +// This program is distributed in the hope that it will be useful, but // +// WITHOUT ANY WARRANTY; without even the implied warranty of // +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // +// General Public License for more details. // +// // +// You should have received a copy of the GNU General Public License // +// along with this program. If not, see . // +// // +// Written by and Copyright (C) Francois Fleuret // +// Contact for comments & bug reports // +/////////////////////////////////////////////////////////////////////////// + +#ifndef PATH_H +#define PATH_H + +class Path { +public: + Path(int l); + ~Path(); + int length; + int *nodes; +}; + +#endif diff --git a/tracker.h b/tracker.h index f17c7a0..9d3e018 100644 --- a/tracker.h +++ b/tracker.h @@ -39,17 +39,27 @@ public: Tracker(int nb_time_steps, int nb_locations); ~Tracker(); + // Define the spatial topology + void set_allowed_motion(int from_location, int to_location, int v); void set_as_entrance(int location, int v); void set_as_exit(int location, int v); + // Build or print the graph needed for the tracking per se + void build_graph(); void print_graph_dot(ostream *os); + // Define the detection scores + void set_detection_score(int time, int location, scalar_t score); + // Compute the optimal set of trajectories + void track(); + // Read-out of the optimal trajectories + int nb_trajectories(); int trajectory_entrance_time(int k); int trajectory_duration(int k);