makes rankMutations return a value

Class state-machine isn't working very well
This commit is contained in:
Mark Hoekveen
2019-03-03 11:21:12 +01:00
parent aa31c1f513
commit ffed7bff6e
2 changed files with 9 additions and 10 deletions
+8 -9
View File
@@ -162,24 +162,23 @@ void DescriptorManager::rankImages(string image_name, int method) {
//Adds mutated descriptors of a given image to a copy of the distances array.
//It inserts these mutated descriptors in a sorted way
//Assumes the distances array is filled with the normal distances
void DescriptorManager::rankMutations(string image_name, int method) {
multiset<pair<unsigned long long, string>> DescriptorManager::rankMutations(string image_name, int method) {
bitset<64> target;
if (features[method].count(image_name) && initialized) { //if we have image
if (features[method].count(image_name) && initialized) { //this should always be the case
target = features[method][image_name];
}
else {
return;
}
//cout << "Finding hits for " << image_name << " which has feature-number " << target.to_ullong() << endl;
multiset<pair<unsigned long long, string> > local_distance = distances; //get our local copy of the distances.
multiset<pair<unsigned long long, string>> local_distance = distances; //get our local copy of the distances.
for (int i = 0; i < numMutations; i++) {
bitset<64> b1 = mutatedFeatures[method][i][image_name];
unsigned long long d = descriptor_types[method]->distance(target, b1);
pair<unsigned long long, string> p(d, mutators[i]->ToString());
local_distance.insert(p);
upper_bound
//upper_bound
}
return local_distance;
/*
//cout << "..." << endl;
for (int i = 0; i < numMutations; i++) {
int j = 0;
@@ -191,7 +190,7 @@ void DescriptorManager::rankMutations(string image_name, int method) {
}
j++;
}
}
}*/
}
//Needs to be called after Init().