knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
Builder.hpp
Go to the documentation of this file.
1#ifndef KNNCOLLE_BUILDER_HPP
2#define KNNCOLLE_BUILDER_HPP
3
4#include "Prebuilt.hpp"
5#include <memory>
6
13namespace knncolle {
14
21template<class Matrix_, typename Float_>
22class Builder {
23public:
27 virtual ~Builder() = default;
37
42 std::shared_ptr<Prebuilt<typename Matrix_::dimension_type, typename Matrix_::index_type, Float_> > build_shared(const Matrix_& data) const {
43 return std::shared_ptr<Prebuilt<typename Matrix_::dimension_type, typename Matrix_::index_type, Float_> >(build_raw(data));
44 }
45
50 std::unique_ptr<Prebuilt<typename Matrix_::dimension_type, typename Matrix_::index_type, Float_> > build_unique(const Matrix_& data) const {
51 return std::unique_ptr<Prebuilt<typename Matrix_::dimension_type, typename Matrix_::index_type, Float_> >(build_raw(data));
52 }
53};
54
55}
56
57#endif
Interface for prebuilt nearest-neighbor indices.
Interface to build nearest-neighbor search indices.
Definition Builder.hpp:22
virtual Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > * build_raw(const Matrix_ &data) const =0
std::shared_ptr< Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > > build_shared(const Matrix_ &data) const
Definition Builder.hpp:42
std::unique_ptr< Prebuilt< typename Matrix_::dimension_type, typename Matrix_::index_type, Float_ > > build_unique(const Matrix_ &data) const
Definition Builder.hpp:50
Interface for prebuilt nearest-neighbor search indices.
Definition Prebuilt.hpp:28
Collection of KNN algorithms.
Definition Bruteforce.hpp:22