Jafar
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes
jafar::lines::MatchingSet Class Reference

Container for a matching. More...


Detailed Description

Container for a matching.

Container for a matching. In jafar::lines it is used as container for matchings of line segments, but there is no limitation to that.

Definition at line 67 of file matchingSet.hpp.

#include <matchingSet.hpp>

List of all members.

Public Member Functions

 MatchingSet (MatchRepres _matchRep=FAST_MATCH_ACCESS)
 Constructor with indicator for the type of storage for the matchings.
void clear ()
 Clears the matchings.
void addMatching (int indA, int indB)
 Add a new matching to the storage.
void print ()
 Print the matching on std::out.
bool searchMatching (int indA, int indB)
 Searches matching between line indA and line indB therefore indB is searches under all possible matchings for line indA return 1 if found, else 0.
int getMaxInd ()
 To get maximum index of the matching.
void erase (unsigned int index)
 Erase a matching by its index in oldIdx and newIdx.

Static Public Member Functions

static void compareMatchingSets (MatchingSet *newMatching, MatchingSet *refMatching, MatchStatistic *statistic)
 Compares two matchings.
static void clone (MatchingSet &old, MatchingSet &clone)
 Copys a matching.

Public Attributes

std::vector< std::vector< int > > map
 Container for the matching.
std::vector< int > oldIdx
 This is one of the containers for the matching FAST_MATCH_ACCESS or BOTH_MATCH_ACCESS_TYPES. It contains the index of the old line, the index of the new line is at the same position in newIdx.
std::vector< int > newIdx
 This is one of the containers for the matching FAST_MATCH_ACCESS or BOTH_MATCH_ACCESS_TYPES. It contains the index of the new line, the index of the old line is at the same position in oldIdx.

Private Attributes

int maxInd
 maximum index is the number of last matched line neccessary to identify non matched lines (out of interval [0 maxInd] or value -1) (only valid if matchRep is FAST_OLD_LINE_MATCH_ACCESS or BOTH_MATCH_ACCESS_TYPES
MatchRepres matchRep
 Indicates the type of storage for the matchings.

Constructor & Destructor Documentation

jafar::lines::MatchingSet::MatchingSet ( MatchRepres  _matchRep = FAST_MATCH_ACCESS)

Constructor with indicator for the type of storage for the matchings.

Constructor with indicator for the type of storage for the matchings. The default value provids fast access to all matches of an old line. The other values are described in lines::MatchRepres enumeration.


Member Function Documentation

void jafar::lines::MatchingSet::addMatching ( int  indA,
int  indB 
)

Add a new matching to the storage.

This is the function to extend the matching set with a new matching. The internal data structure for the matching set is extended automatically. It is possible to assign several new indexes to one old by calling this function several times. Vice versa as well.

Parameters:
indAIs the index of the part of the old set.
indBIs the index of the part of the new set.

Clears the matchings.

This function clears the content of the macthing and can be used to prepare the next macthing step.

static void jafar::lines::MatchingSet::clone ( MatchingSet old,
MatchingSet clone 
) [static]

Copys a matching.

This function copys the content of old matching to clone matching. The prior content of clone is lost.

Parameters:
oldThe old matching set which content is copyed
cloneThe storage for the copy.
static void jafar::lines::MatchingSet::compareMatchingSets ( MatchingSet newMatching,
MatchingSet refMatching,
MatchStatistic statistic 
) [static]

Compares two matchings.

Compares two matchings.They must have the same maxInd value (means the same number of lines) The result of the comparison is stored in statistic. Actually there is the following content:

"right" is total number of matchings with: something from newMatching is in refMatching or there is nothing in both.

"wrong" is total number of matchings with: there is something in newMatching and this is all not in refMatching.

"notFound" is total number of matchings with: there is nothing in newMatching but something in refMatching.

Parameters:
newMatchingThe matching that should be evaluated
refMatchingThe reference matching (maybe validated manually or with a good tracking)
statisticStorage for the result of comparison
void jafar::lines::MatchingSet::erase ( unsigned int  index)

Erase a matching by its index in oldIdx and newIdx.

Erase a matching by its index in oldIdx and newIdx. It is also deleted in map if matchRep is BOTH_MATCH_ACCESS_TYPES, but that is not efficient implemented

Print the matching on std::out.

Print the matching on std::out. The first column are the old indexes and right beside there is a list of the matchings in the new set. -1 value indicates there is no matching.


Member Data Documentation

std::vector< std::vector<int> > jafar::lines::MatchingSet::map

Container for the matching.

This is one of the containers for the matching, its used if matchRep is set to FAST_OLD_LINE_MATCH_ACCESS, or BOTH_MATCH_ACCESS_TYPES. It is organized as follows: in map[i] there is a vector with all indices of new lines that are matched to old line i The size of map is updated automatically (if there is a matching for old index i, then all indexes smaller i get a matching of -1 if they are not matched yet.

Definition at line 148 of file matchingSet.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Wed Oct 15 2014 00:37:42 for Jafar by doxygen 1.7.6.1
LAAS-CNRS