91 std::map<int, int>
matcher(
const std::vector<Tp*>&
ref,
const std::vector<Tq*>& test) {
99 std::multiset<matched_> m;
101 for (
unsigned int i=0 ; i<
ref.size() ; i++ ) {
103 for (
unsigned int j=0 ; j<test.size() ; j++ ) {
106 m.insert( matched_(d, i, j) );
115 std::vector<bool> refused(
ref.size(),
false );
116 std::vector<bool> testused( test.size(),
false );
122 std::multiset<matched_> unique;
124 typename std::multiset<matched_>::iterator mitr = m.begin();
126 for ( ; mitr!=m.end() ; ++mitr ) {
128 int rind = mitr->first();
129 int tind = mitr->second();
131 if ( refused[rind] )
continue;
132 if ( testused[tind] )
continue;
134 refused[rind] =
true;
135 testused[tind] =
true;
137 unique.insert( *mitr );
149 std::map<int, int> matches;
152 mitr = unique.begin();
153 while ( mitr!=unique.end() ) {
154 matches.insert( std::map<int, int>::value_type( mitr->first(), mitr->second() ) );