Fix float-conversion warnings in FLANN by using float literals

This commit is contained in:
sight 2025-06-17 09:59:44 +00:00
parent 30130cdc86
commit 37a3eddd53
3 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,7 @@ NNIndex<Distance>* create_index_by_type(const Matrix<typename Distance::ElementT
struct AutotunedIndexParams : public IndexParams
{
AutotunedIndexParams(float target_precision = 0.8, float build_weight = 0.01, float memory_weight = 0, float sample_fraction = 0.1)
AutotunedIndexParams(float target_precision = 0.8f, float build_weight = 0.01f, float memory_weight = 0.f, float sample_fraction = 0.1f)
{
(*this)["algorithm"] = FLANN_INDEX_AUTOTUNED;
// precision desired (used for autotuning, -1 otherwise)

View File

@ -46,7 +46,7 @@ namespace cvflann
struct CompositeIndexParams : public IndexParams
{
CompositeIndexParams(int trees = 4, int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2 )
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2f )
{
(*this)["algorithm"] = FLANN_INDEX_KMEANS;
// number of randomized trees to use (for kdtree)

View File

@ -62,7 +62,7 @@ struct KMeansIndexParams : public IndexParams
{
KMeansIndexParams(int branching = 32, int iterations = 11,
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM,
float cb_index = 0.2, int trees = 1 )
float cb_index = 0.2f, int trees = 1 )
{
(*this)["algorithm"] = FLANN_INDEX_KMEANS;
// branching factor