mirror of
https://github.com/opencv/opencv.git
synced 2026-09-12 13:23:03 -05:00
Merge pull request #29758 from seanm:Wfloat-conversion
Fixed Clang -Wfloat-conversion warning in public header
This commit is contained in:
@@ -230,7 +230,7 @@ public:
|
||||
private:
|
||||
/** Defines the comparator on score and index
|
||||
*/
|
||||
typedef std::pair<float, unsigned int> ScoreIndexPair;
|
||||
typedef std::pair<DistanceType, unsigned int> ScoreIndexPair;
|
||||
struct SortScoreIndexPairOnSecond
|
||||
{
|
||||
bool operator()(const ScoreIndexPair& left, const ScoreIndexPair& right) const
|
||||
@@ -271,7 +271,7 @@ private:
|
||||
static std::vector<ScoreIndexPair> score_index_heap;
|
||||
|
||||
if (do_k) {
|
||||
unsigned int worst_score = std::numeric_limits<unsigned int>::max();
|
||||
DistanceType worst_score = std::numeric_limits<DistanceType>::max();
|
||||
typename std::vector<lsh::LshTable<ElementType> >::const_iterator table = tables_.begin();
|
||||
typename std::vector<lsh::LshTable<ElementType> >::const_iterator table_end = tables_.end();
|
||||
for (; table != table_end; ++table) {
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
//! @cond IGNORED
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <iomanip>
|
||||
#include <limits.h>
|
||||
@@ -52,7 +53,6 @@
|
||||
#else
|
||||
#include <map>
|
||||
#endif
|
||||
#include <math.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "dynamic_bitset.h"
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
void add(Matrix<ElementType> dataset)
|
||||
{
|
||||
#if USE_UNORDERED_MAP
|
||||
buckets_space_.rehash((buckets_space_.size() + dataset.rows) * 1.2);
|
||||
buckets_space_.rehash(std::llround((buckets_space_.size() + dataset.rows) * 1.2));
|
||||
#endif
|
||||
// Add the features to the table
|
||||
for (unsigned int i = 0; i < dataset.rows; ++i) add(i, dataset[i]);
|
||||
|
||||
@@ -332,7 +332,7 @@ inline float calcSubpixel(const float &x_l,const float &x,const float &x_r)
|
||||
const float l1 = float(std::log(x+1e-6));
|
||||
const float l2 = float(std::log(x_r+1e-6));
|
||||
float delta = l2-l1-l1+l0;
|
||||
if(!delta) // this happens if all values are identical
|
||||
if(delta == 0.0f) // this happens if all values are identical
|
||||
return 0;
|
||||
delta = (l0-l2)/(delta+delta);
|
||||
return delta;
|
||||
|
||||
Reference in New Issue
Block a user