#include <PairMatchMulti.h>
Public Member Functions | |
PairMatchMulti () | |
Default constructor. | |
PairMatchMulti (vcl_istream &s) | |
PairMatchMulti (const PairMatchMulti &that) | |
Copy ctor. | |
~PairMatchMulti () | |
Destructor. | |
PairMatchMulti & | operator= (const PairMatchMulti &that) |
Assignment. | |
void | add_match (int i1, int i2) |
Add a match $(i_1, i_2)$ to the set. | |
bool | contains (int i1, int i2) const |
void | add_match (int i1, int i2, double score) |
Add a match $(i_1, i_2)$ to the set. | |
double | get_score (int i1, int i2) const |
void | set_score (int i1, int i2, double score) |
void | clear () |
Clear all matches. | |
int | size () const |
int | count () const |
unsigned | count_matches_12 (int i1) const |
Return the number of matches for i1. | |
PairMatchMultiIterator | get_match_12 (int i1) |
Return an iterator which will run through the list of matches for feature index i1. | |
PairMatchMultiIterator | get_match_21 (int) |
Return an iterator which will run through the list of matches for feature index i2. | |
PairMatchMultiIterator | iter () |
Return an iterator that traverses the entire match set. | |
bool | is_superset (PairMatchSet &unique_set) |
bool | operator== (PairMatchMulti const &that) const |
bool | load (char const *filename) |
load from ascii file. | |
bool | read_ascii (vcl_istream &s) |
Private Attributes | |
vcl_multimap_uint_uint | matches12_ |
vbl_sparse_array_2d< double > * | scores_ |
Friends | |
class | PairMatchMultiIterator |
Definition at line 34 of file PairMatchMulti.h.
PairMatchMulti::PairMatchMulti | ( | ) |
Default constructor.
Definition at line 28 of file PairMatchMulti.cxx.
PairMatchMulti::PairMatchMulti | ( | vcl_istream & | s | ) |
Definition at line 34 of file PairMatchMulti.cxx.
PairMatchMulti::PairMatchMulti | ( | const PairMatchMulti & | that | ) |
Copy ctor.
Definition at line 41 of file PairMatchMulti.cxx.
PairMatchMulti::~PairMatchMulti | ( | ) |
Destructor.
Definition at line 58 of file PairMatchMulti.cxx.
void PairMatchMulti::add_match | ( | int | i1, |
int | i2 | ||
) | [inline] |
Add a match $(i_1, i_2)$ to the set.
Definition at line 54 of file PairMatchMulti.h.
void PairMatchMulti::add_match | ( | int | i1, |
int | i2, | ||
double | score | ||
) |
Add a match $(i_1, i_2)$ to the set.
Definition at line 63 of file PairMatchMulti.cxx.
void PairMatchMulti::clear | ( | ) | [inline] |
Clear all matches.
Definition at line 67 of file PairMatchMulti.h.
bool PairMatchMulti::contains | ( | int | i1, |
int | i2 | ||
) | const |
Definition at line 77 of file PairMatchMulti.cxx.
int PairMatchMulti::count | ( | ) | const [inline] |
Definition at line 74 of file PairMatchMulti.h.
unsigned PairMatchMulti::count_matches_12 | ( | int | i1 | ) | const [inline] |
Return the number of matches for i1.
Definition at line 77 of file PairMatchMulti.h.
PairMatchMultiIterator PairMatchMulti::get_match_12 | ( | int | i1 | ) | [inline] |
Return an iterator which will run through the list of matches for feature index i1.
Example usage: to print all matches for "target"
for (PairMatchMultiIterator p = mm.get_match_12(target); !p.done(); p.next()) vcl_cout << p.get_i1() << ' ' << p.get_i2() << vcl_endl;
Complexity is O(log n).
Definition at line 86 of file PairMatchMulti.h.
PairMatchMultiIterator PairMatchMulti::get_match_21 | ( | int | ) | [inline] |
Return an iterator which will run through the list of matches for feature index i2.
This may be expensive. If it is used a lot, it may be worth maintaining forward and backward maps. Right now it's not even implemented.
Definition at line 94 of file PairMatchMulti.h.
double PairMatchMulti::get_score | ( | int | i1, |
int | i2 | ||
) | const |
Definition at line 85 of file PairMatchMulti.cxx.
bool PairMatchMulti::is_superset | ( | PairMatchSet & | unique_set | ) |
Definition at line 161 of file PairMatchMulti.cxx.
PairMatchMultiIterator PairMatchMulti::iter | ( | ) | [inline] |
Return an iterator that traverses the entire match set.
Definition at line 97 of file PairMatchMulti.h.
bool PairMatchMulti::load | ( | char const * | filename | ) |
load from ascii file.
Definition at line 201 of file PairMatchMulti.cxx.
PairMatchMulti & PairMatchMulti::operator= | ( | const PairMatchMulti & | that | ) |
Assignment.
Definition at line 48 of file PairMatchMulti.cxx.
bool PairMatchMulti::operator== | ( | PairMatchMulti const & | that | ) | const [inline] |
Definition at line 105 of file PairMatchMulti.h.
bool PairMatchMulti::read_ascii | ( | vcl_istream & | s | ) |
Definition at line 128 of file PairMatchMulti.cxx.
void PairMatchMulti::set_score | ( | int | i1, |
int | i2, | ||
double | score | ||
) |
Definition at line 69 of file PairMatchMulti.cxx.
int PairMatchMulti::size | ( | ) | const [inline] |
Definition at line 71 of file PairMatchMulti.h.
friend class PairMatchMultiIterator [friend] |
Definition at line 40 of file PairMatchMulti.h.
Definition at line 37 of file PairMatchMulti.h.
vbl_sparse_array_2d<double>* PairMatchMulti::scores_ [private] |
Definition at line 38 of file PairMatchMulti.h.