#include <TripleMatchSet.h>
Classes | |
class | iterator |
Public Types | |
enum | { NoMatch = -1 } |
Public Member Functions | |
TripleMatchSet (int i1_max, int i2_max, int i3_max) | |
Initialize a TripleMatchSet, by specifying the maximum i1, i2, i3 values. | |
~TripleMatchSet () | |
Delete the PairMatchSets. | |
void | clear_matches () |
Remove all tuples. | |
void | clear_nontriplets () |
int | count () const |
Return the number of triplets. O(n). | |
bool | add_match (int i, int ii, int iii) |
Add triplet (i1, i2, i3) to the matchset. | |
bool | delete_match (int i1, int i2, int i3) |
bool | contains (int i1, int i2, int i3) |
bool | get_1 (int i1, int *i1out, int *i2out, int *i3out) const |
Select(1 = c). | |
bool | get_2 (int i2, int *i1out, int *i2out, int *i3out) const |
Select(2 = c). | |
bool | get_3 (int i3, int *i1out, int *i2out, int *i3out) const |
Select(3 = c). | |
int | get_match_12 (int i1) const |
Select(1 = i1).2, meaning take the 2nd component of the tuples in which the first component equals i1. | |
int | get_match_23 (int i2) const |
Select(2 = i2).3 Complexity O(1). | |
int | get_match_31 (int i3) const |
Select(3 = i3).1 Complexity O(n). | |
int | get_match_21 (int i2) const |
Select(2 = i2).1 Complexity O(n). | |
int | get_match_32 (int i3) const |
Select(3 = i3).2 Complexity O(n). | |
int | get_match_13 (int i1) const |
Select(1 = i1).3. | |
int | get_match_123 (int i1, int i2) const |
Select({1,2} = {i1, i2}).3. | |
void | set (PairMatchSet *match12, PairMatchSet *match23) |
Destroy current PairMatchSets and adopt two new ones. | |
void | set_from_pairwise_matches (const PairMatchSet &matches12, const PairMatchSet &matches23) |
Join two PairMatchSets on their 2nd and 1st columns respectively. | |
void | write_ascii (vcl_ostream &s) const |
Write as three ascii columns. | |
bool | read_ascii (vcl_istream &s) |
Read from ascii vcl_istream. | |
void | update_feature_match_data () |
int | size () const |
bool | get_match (int at, int *i1, int *i2, int *i3) const |
iterator | begin () const |
Static Public Member Functions | |
static bool | matchp (int i) |
Return true if i is not the "NoMatch" value. | |
Protected Member Functions | |
TripleMatchSet (PairMatchSet *match12, PairMatchSet *match23) | |
Initialize a TripleMatchSet from a pair of PairMatchSets. | |
Protected Attributes | |
PairMatchSet * | match12_ |
PairMatchSet * | match23_ |
Definition at line 37 of file TripleMatchSet.h.
anonymous enum [inherited] |
Definition at line 29 of file MatchSet.h.
TripleMatchSet::TripleMatchSet | ( | PairMatchSet * | match12, |
PairMatchSet * | match23 | ||
) | [protected] |
Initialize a TripleMatchSet from a pair of PairMatchSets.
The PairMatchSets are adopted by the TripleMatchSet, which will delete them.
Definition at line 18 of file TripleMatchSet.cxx.
TripleMatchSet::TripleMatchSet | ( | int | i1_max, |
int | i2_max, | ||
int | i3_max | ||
) |
Initialize a TripleMatchSet, by specifying the maximum i1, i2, i3 values.
Keep these conservative, as arrays of that length will be made. Currently the i3 value is ignored.
Definition at line 27 of file TripleMatchSet.cxx.
TripleMatchSet::~TripleMatchSet | ( | ) |
Delete the PairMatchSets.
Definition at line 34 of file TripleMatchSet.cxx.
bool TripleMatchSet::add_match | ( | int | i1, |
int | i2, | ||
int | i3 | ||
) |
Add triplet (i1, i2, i3) to the matchset.
Any existing matches of the form (i1, *, *) are removed. O(1).
Definition at line 127 of file TripleMatchSet.cxx.
iterator TripleMatchSet::begin | ( | ) | const [inline] |
Definition at line 102 of file TripleMatchSet.h.
void TripleMatchSet::clear_matches | ( | ) |
Remove all tuples.
Definition at line 156 of file TripleMatchSet.cxx.
void TripleMatchSet::clear_nontriplets | ( | ) |
Definition at line 245 of file TripleMatchSet.cxx.
bool TripleMatchSet::contains | ( | int | i1, |
int | i2, | ||
int | i3 | ||
) |
int TripleMatchSet::count | ( | ) | const |
Return the number of triplets. O(n).
Definition at line 147 of file TripleMatchSet.cxx.
bool TripleMatchSet::delete_match | ( | int | i1, |
int | i2, | ||
int | i3 | ||
) |
Definition at line 281 of file TripleMatchSet.cxx.
bool TripleMatchSet::get_1 | ( | int | c, |
int * | i1, | ||
int * | i2, | ||
int * | i3 | ||
) | const |
Select(1 = c).
{1,2,3}. Complexity O(1). Returns true iff a match was found.
Definition at line 214 of file TripleMatchSet.cxx.
bool TripleMatchSet::get_2 | ( | int | c, |
int * | i1, | ||
int * | i2, | ||
int * | i3 | ||
) | const |
bool TripleMatchSet::get_3 | ( | int | c, |
int * | i1, | ||
int * | i2, | ||
int * | i3 | ||
) | const |
bool TripleMatchSet::get_match | ( | int | at, |
int * | i1, | ||
int * | i2, | ||
int * | i3 | ||
) | const [inline] |
Definition at line 74 of file TripleMatchSet.h.
int TripleMatchSet::get_match_12 | ( | int | i1 | ) | const |
Select(1 = i1).2, meaning take the 2nd component of the tuples in which the first component equals i1.
Complexity O(1).
Definition at line 165 of file TripleMatchSet.cxx.
int TripleMatchSet::get_match_123 | ( | int | i1, |
int | i2 | ||
) | const |
int TripleMatchSet::get_match_13 | ( | int | i1 | ) | const |
int TripleMatchSet::get_match_21 | ( | int | i2 | ) | const |
Select(2 = i2).1 Complexity O(n).
Definition at line 184 of file TripleMatchSet.cxx.
int TripleMatchSet::get_match_23 | ( | int | i2 | ) | const |
Select(2 = i2).3 Complexity O(1).
Definition at line 178 of file TripleMatchSet.cxx.
int TripleMatchSet::get_match_31 | ( | int | i3 | ) | const |
Select(3 = i3).1 Complexity O(n).
Definition at line 190 of file TripleMatchSet.cxx.
int TripleMatchSet::get_match_32 | ( | int | i3 | ) | const |
Select(3 = i3).2 Complexity O(n).
Definition at line 196 of file TripleMatchSet.cxx.
static bool MatchSet::matchp | ( | int | i | ) | [inline, static, inherited] |
Return true if i is not the "NoMatch" value.
Definition at line 32 of file MatchSet.h.
bool TripleMatchSet::read_ascii | ( | vcl_istream & | s | ) |
Read from ascii vcl_istream.
Definition at line 77 of file TripleMatchSet.cxx.
void TripleMatchSet::set | ( | PairMatchSet * | match12, |
PairMatchSet * | match23 | ||
) |
Destroy current PairMatchSets and adopt two new ones.
Definition at line 41 of file TripleMatchSet.cxx.
void TripleMatchSet::set_from_pairwise_matches | ( | const PairMatchSet & | matches12, |
const PairMatchSet & | matches23 | ||
) |
Join two PairMatchSets on their 2nd and 1st columns respectively.
I.e. make the TripleMatchSet which contains (i1,i2,i3) iff
matches12.contains(i1, i2) and matches23.contains(i2, i3)
Definition at line 54 of file TripleMatchSet.cxx.
int TripleMatchSet::size | ( | ) | const |
Definition at line 300 of file TripleMatchSet.cxx.
void TripleMatchSet::update_feature_match_data | ( | ) |
Definition at line 306 of file TripleMatchSet.cxx.
void TripleMatchSet::write_ascii | ( | vcl_ostream & | s | ) | const |
Write as three ascii columns.
Definition at line 67 of file TripleMatchSet.cxx.
PairMatchSet* TripleMatchSet::match12_ [protected] |
Definition at line 107 of file TripleMatchSet.h.
PairMatchSet* TripleMatchSet::match23_ [protected] |
Definition at line 108 of file TripleMatchSet.h.