Commit 21d912646bfd1cc7027a9e02ce75381283b4a664

Authored by Scott Klum
1 parent fe93bf86

Fixed type bug in OperationDistance

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