Commit 21d912646bfd1cc7027a9e02ce75381283b4a664

Authored by Scott Klum
1 parent fe93bf86

Fixed type bug in OperationDistance

openbr/plugins/distance.cpp
@@ -213,10 +213,10 @@ private: @@ -213,10 +213,10 @@ private:
213 213
214 switch (operation) { 214 switch (operation) {
215 case Mean: 215 case Mean:
216 - return std::accumulate(distances.begin(),distances.end(),0)/(float)distances.size(); 216 + return std::accumulate(distances.begin(),distances.end(),0.0)/(float)distances.size();
217 break; 217 break;
218 case Sum: 218 case Sum:
219 - return std::accumulate(distances.begin(),distances.end(),0); 219 + return std::accumulate(distances.begin(),distances.end(),0.0);
220 break; 220 break;
221 case Min: 221 case Min:
222 return *std::min_element(distances.begin(),distances.end()); 222 return *std::min_element(distances.begin(),distances.end());
openbr/plugins/validate.cpp
@@ -255,7 +255,7 @@ class RejectDistance : public Distance @@ -255,7 +255,7 @@ class RejectDistance : public Distance
255 { 255 {
256 // We don't look at the query 256 // We don't look at the query
257 (void) b; 257 (void) b;
258 - 258 +
259 foreach (const QString &key, keys) 259 foreach (const QString &key, keys)
260 if ((rejectIfContains && a.file.contains(key)) || (!rejectIfContains && !a.file.contains(key))) 260 if ((rejectIfContains && a.file.contains(key)) || (!rejectIfContains && !a.file.contains(key)))
261 return -std::numeric_limits<float>::max(); 261 return -std::numeric_limits<float>::max();