31 #ifndef RTABMAP_FLANN_LINEAR_INDEX_H_ 32 #define RTABMAP_FLANN_LINEAR_INDEX_H_ 48 template <
typename Distance>
66 setDataset(input_data);
90 assert(points.
cols==veclen_);
91 extendDataset(points);
105 template<
typename Archive>
112 if (Archive::is_loading::value) {
113 index_params_[
"algorithm"] = getType();
132 for (
size_t i = 0; i < points_.size(); ++i) {
133 if (removed_points_.test(i))
continue;
134 DistanceType
dist = distance_(points_[i], vec, veclen_);
139 for (
size_t i = 0; i < points_.size(); ++i) {
140 DistanceType
dist = distance_(points_[i], vec, veclen_);
163 #endif // FLANN_LINEAR_INDEX_H_
std::map< std::string, any > IndexParams
void serialize(Archive &ar)
LinearIndex(const Matrix< ElementType > &input_data, const IndexParams ¶ms=LinearIndexParams(), Distance d=Distance())
Distance::ResultType DistanceType
void swap(linb::any &lhs, linb::any &rhs) noexcept
void loadIndex(FILE *stream)
#define USING_BASECLASS_SYMBOLS
LinearIndex & operator=(LinearIndex other)
Distance::ElementType ElementType
LinearIndex(const LinearIndex &other)
BaseClass * clone() const
void findNeighbors(ResultSet< DistanceType > &resultSet, const ElementType *vec, const SearchParams &) const
LinearIndex(const IndexParams ¶ms=LinearIndexParams(), Distance d=Distance())
NNIndex< Distance > BaseClass
void saveIndex(FILE *stream)
void addPoints(const Matrix< ElementType > &points, float rebuild_threshold=2)
Incrementally add points to the index.
virtual void addPoint(DistanceType dist, size_t index)=0
flann_algorithm_t getType() const