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();
128 for ( ; mitr!=m.end() ; ++mitr ) {
130 int rind = mitr->first();
131 int tind = mitr->second();
133 if ( refused[rind] )
continue;
134 if ( testused[tind] )
continue;
136 refused[rind] =
true;
137 testused[tind] =
true;
139 unique.insert( *mitr );
141 chi2 += (mitr->d()*mitr->d());
154 std::map<int, int> matches;
157 mitr = unique.begin();
158 while ( mitr!=unique.end() ) {
159 matches.insert( std::map<int, int>::value_type( mitr->first(), mitr->second() ) );