Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cpp/flann/algorithms/autotuned_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ inline NNIndex<Distance>*

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)
Expand Down Expand Up @@ -161,7 +161,7 @@ class AutotunedIndex : public NNIndex<Distance>
}


void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2)
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2.f)
{
if (bestIndex_) {
bestIndex_->addPoints(points, rebuild_threshold);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/flann/algorithms/composite_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace flann
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)
Expand Down Expand Up @@ -166,7 +166,7 @@ class CompositeIndex : public NNIndex<Distance>
kdtree_index_->buildIndex();
}

void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2)
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2.f)
{
kmeans_index_->addPoints(points, rebuild_threshold);
kdtree_index_->addPoints(points, rebuild_threshold);
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/flann/algorithms/kmeans_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace flann
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 )
flann_centers_init_t centers_init = FLANN_CENTERS_RANDOM, float cb_index = 0.2f )
{
(*this)["algorithm"] = FLANN_INDEX_KMEANS;
// branching factor
Expand Down Expand Up @@ -212,7 +212,7 @@ class KMeansIndex : public NNIndex<Distance>

using BaseClass::buildIndex;

void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2)
void addPoints(const Matrix<ElementType>& points, float rebuild_threshold = 2.f)
{
assert(points.cols==veclen_);
size_t old_size = size_;
Expand Down
1 change: 1 addition & 0 deletions src/cpp/flann/flann.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,7 @@ class Index
}
IndexHeader header = load_header(fin);
if (header.h.data_type != flann_datatype_value<ElementType>::value) {
fclose(fin);
throw FLANNException("Datatype of saved index is different than of the one to be loaded.");
}

Expand Down
16 changes: 8 additions & 8 deletions src/cpp/flann/util/dynamic_bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ namespace flann {
class DynamicBitset
{
public:
/** @param default constructor
/** default constructor
*/
DynamicBitset() : size_(0)
{
}

/** @param only constructor we use in our code
/** only constructor we use in our code
* @param the size of the bitset (in bits)
*/
DynamicBitset(size_t size)
Expand All @@ -82,15 +82,15 @@ class DynamicBitset
return bitset_.empty();
}

/** @param set all the bits to 0
/** set all the bits to 0
*/
void reset()
{
std::fill(bitset_.begin(), bitset_.end(), 0);
}

/** @brief set one bit to 0
* @param
* @param index
*/
void reset(size_t index)
{
Expand All @@ -101,7 +101,7 @@ class DynamicBitset
* This function is useful when resetting a given set of bits so that the
* whole bitset ends up being 0: if that's the case, we don't care about setting
* other bits to 0
* @param
* @param index
*/
void reset_block(size_t index)
{
Expand All @@ -117,22 +117,22 @@ class DynamicBitset
bitset_.resize(size / cell_bit_size_ + 1);
}

/** @param set a bit to true
/** set a bit to true
* @param index the index of the bit to set to 1
*/
void set(size_t index)
{
bitset_[index / cell_bit_size_] |= size_t(1) << (index % cell_bit_size_);
}

/** @param gives the number of contained bits
/** gives the number of contained bits
*/
size_t size() const
{
return size_;
}

/** @param check if a bit is set
/** check if a bit is set
* @param index the index of the bit to check
* @return true if the bit is set
*/
Expand Down
4 changes: 3 additions & 1 deletion src/cpp/flann/util/lsh_table.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,10 @@ class LshTable
* @param feature_size is the size of the feature (considered as a ElementType[])
* @param key_size is the number of bits that are turned on in the feature
*/
LshTable(unsigned int /*feature_size*/, unsigned int /*key_size*/)
LshTable(unsigned int feature_size, unsigned int key_size)
{
(void)feature_size;
(void)key_size;
std::cerr << "LSH is not implemented for that type" << std::endl;
throw;
}
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/flann/util/result_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ class RadiusUniqueResultSet : public UniqueResultSet<DistanceType>
{
public:
/** Constructor
* @param capacity the number of neighbors to store at max
* @param radius the maximum distance of a neighbor
*/
RadiusUniqueResultSet(DistanceType radius) :
radius_(radius)
Expand Down Expand Up @@ -905,6 +905,7 @@ class KNNRadiusUniqueResultSet : public KNNUniqueResultSet<DistanceType>
public:
/** Constructor
* @param capacity the number of neighbors to store at max
* @param radius the maximum distance of a neighbor
*/
KNNRadiusUniqueResultSet(DistanceType radius, size_t capacity) : KNNUniqueResultSet<DistanceType>(capacity)
{
Expand Down