19 #ifndef MCMCDA_TRACK_H_INCLUDED
20 #define MCMCDA_TRACK_H_INCLUDED
46 typedef std::multimap<int, const Element*> Parent;
47 mutable int chg_start_;
59 template<
class Iterator>
77 using Parent::equal_range;
78 using Parent::lower_bound;
79 using Parent::upper_bound;
96 return begin()->first;
105 return rbegin()->first;
114 IFTD(!empty() && rsz > static_cast<size_t>(n) && n > 0,
116 "get_nth_time: cannot get %dth time, track has length %d.",
154 "get_next_time: track has no after points time %d.", (t));
168 "get_next_time: track has no before points time %d.", (t));
180 return *(begin()->second);
189 return *(rbegin()->second);
231 friend bool operator<
238 friend bool operator==
245 friend bool operator!=
254 swap(t1.chg_start_, t2.chg_start_);
293 template<
class Element>
307 it = track1.upper_bound(t1);
309 "swap_tracks: track1 has no point after time %d.", (t1));
310 track1.erase(it, track1.end());
312 it = track2.find(tq1);
314 "swap_tracks: track2 has no point at time %d.", (tq1));
315 track1.insert(it, track2.end());
317 it = track2.upper_bound(t2);
319 "swap_tracks: track2 has no point after time %d.", (t2));
320 track2.erase(it, track2.end());
322 it = temp_track.find(tp1);
324 "swap_tracks: track1 has no point at time %d.", (tp1));
325 track2.insert(it, temp_track.end());
332 template<
class Element>
349 template<
class Element>
369 int d = pair_p2->first - pair_p1->first;
392 const std::multimap<int, const E*>& m1 = t1;
393 const std::multimap<int, const E*>& m2 = t2;
405 const std::multimap<int, const E*>& m1 = t1;
406 const std::multimap<int, const E*>& m2 = t2;
414 template<
class Element>
422 const std::multimap<int, const Element*>& m1 = t1;
423 const std::multimap<int, const Element*>& m2 = t2;
int get_end_time() const
Gets end time of track.
Definition: mcmcda_track.h:102
Parent::reference reference
Definition: mcmcda_track.h:87
Definition of various standard probability distributions.
Parent::key_type key_type
Definition: mcmcda_track.h:85
Object thrown when an index argument exceeds the size of a container.
Definition: l_exception.h:399
Parent::const_iterator const_iterator
Definition: mcmcda_track.h:81
int get_random_time() const
Gets a random time from track.
Definition: mcmcda_track.h:139
void set_changed_start(int f) const
Set the changed flag of this track.
Definition: mcmcda_track.h:208
Parent::mapped_type mapped_type
Definition: mcmcda_track.h:86
for k
Definition: APPgetLargeConnectedEdges.m:61
int get_start_time() const
Gets start time of track.
Definition: mcmcda_track.h:93
bool is_valid(double v_bar, int d_bar, double sg, const typename Data< Element >::Convert &to_vector) const
Determines whether this track is valid.
Definition: mcmcda_track.h:351
A class that represents a generic MCMCDA track.
Definition: mcmcda_track.h:40
E Element
Definition: mcmcda_track.h:43
friend void swap(Generic_track< Element > &t1, Generic_track< Element > &t2)
Definition: mcmcda_track.h:251
int get_previous_time(int t) const
Given a time, gets previous time.
Definition: mcmcda_track.h:162
Parent::iterator iterator
Definition: mcmcda_track.h:80
#define IFT(a, ex, msg)
Definition: l_exception.h:101
Parent::const_reverse_iterator const_reverse_iterator
Definition: mcmcda_track.h:83
size_t real_size() const
Get "real" size; i.e., number of frames with detections.
Definition: mcmcda_track.h:333
Parent::reverse_iterator reverse_iterator
Definition: mcmcda_track.h:82
int get_nth_time(int n) const
Gets nth time of track.
Definition: mcmcda_track.h:111
int changed_start() const
Returns changed start flag.
Definition: mcmcda_track.h:196
kjb_c::Pixel abs(const kjb_c::Pixel &p)
Take the channel-wise absolute value of a kjb_c::Pixel.
Definition: i_pixel.h:354
void swap_tracks(Generic_track< Element > &track1, Generic_track< Element > &track2, int t1, int tp1, int t2, int tq1)
Mergest two tracks.
Definition: mcmcda_track.h:295
Generic_track(Iterator first, Iterator last)
Range constructor.
Definition: mcmcda_track.h:60
boost::function1< Vector, const Element & > Convert
Definition: mcmcda_data.h:53
bool operator!=(const Generic_track< E > &t1, const Generic_track< E > &t2)
Compare two generic tracks.
Definition: mcmcda_track.h:403
std::pair< std::vector< Track >, std::vector< size_t > > sample(const Prior< Track > &prior, size_t T, const Track &def)
Sample an association from the prior.
Definition: mcmcda_prior.h:193
count
Definition: APPgetLargeConnectedEdges.m:71
const Element & get_start_point() const
Gets start point of track.
Definition: mcmcda_track.h:177
void swap(kjb::Gsl_Multimin_fdf &m1, kjb::Gsl_Multimin_fdf &m2)
Swap two wrapped multimin objects.
Definition: gsl_multimin.h:693
Exception often thrown when wrapped C functions return error codes.
Definition: l_exception.h:262
void set_changed_end(int f) const
Set the changed flag of this track.
Definition: mcmcda_track.h:214
Sampling functionality for the different distributions defined in "prob_distributions.h".
Parent::const_reference const_reference
Definition: mcmcda_track.h:88
Support for error handling exception classes in libKJB.
int get_next_time(int t) const
Given a time, gets next time.
Definition: mcmcda_track.h:150
Parent::value_type value_type
Definition: mcmcda_track.h:84
#define IFTD(a, ex, msg, params)
Definition: l_exception.h:112
const Element & get_end_point() const
Gets end point of track.
Definition: mcmcda_track.h:186
Generic_track()
Constructor.
Definition: mcmcda_track.h:54
Definition for the Vector class, a thin wrapper on the KJB Vector struct and its related functionalit...
bool operator==(const Generic_track< E > &t1, const Generic_track< E > &t2)
Compare two generic tracks.
Definition: mcmcda_track.h:390
int changed_end() const
Returns changed end flag.
Definition: mcmcda_track.h:202