knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ > Class Template Reference

Index for a VP-tree search. More...

#include <Vptree.hpp>

Inheritance diagram for knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >:
Inheritance graph
[legend]
Collaboration diagram for knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >:
Collaboration graph
[legend]

Public Member Functions

Index_ num_observations () const
 
Dim_ num_dimensions () const
 
 VptreePrebuilt (Dim_ num_dim, Index_ num_obs, std::vector< Store_ > data)
 
std::unique_ptr< Searcher< Index_, Float_ > > initialize () const
 

Friends

class VptreeSearcher< Distance_, Dim_, Index_, Store_, Float_ >
 

Detailed Description

template<class Distance_, typename Dim_, typename Index_, typename Store_, typename Float_>
class knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >

Index for a VP-tree search.

Instances of this class are usually constructed using VptreeBuilder::build_raw().

Template Parameters
Distance_A distance calculation class satisfying the MockDistance contract.
Dim_Integer type for the number of dimensions. For the output of VptreeBuilder::build_raw(), this is set to Matrix_::dimension_type.
Index_Integer type for the indices. For the output of VptreeBuilder::build_raw(), this is set to Matrix_::index_type.
Store_Floating point type for the stored data. For the output of VptreeBuilder::build_raw(), this is set to Matrix_::data_type. This may be set to a lower-precision type than Float_ to save memory.
Float_Floating point type for the query data and distances.

Constructor & Destructor Documentation

◆ VptreePrebuilt()

template<class Distance_ , typename Dim_ , typename Index_ , typename Store_ , typename Float_ >
knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >::VptreePrebuilt ( Dim_  num_dim,
Index_  num_obs,
std::vector< Store_ >  data 
)
inline
Parameters
num_dimNumber of dimensions.
num_obsNumber of observations.
dataVector of length equal to num_dim * num_obs, containing a column-major matrix where rows are dimensions and columns are observations.

Member Function Documentation

◆ initialize()

template<class Distance_ , typename Dim_ , typename Index_ , typename Store_ , typename Float_ >
std::unique_ptr< Searcher< Index_, Float_ > > knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >::initialize ( ) const
inlinevirtual

◆ num_dimensions()

template<class Distance_ , typename Dim_ , typename Index_ , typename Store_ , typename Float_ >
Dim_ knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >::num_dimensions ( ) const
inlinevirtual
Returns
Number of dimensions.

Implements knncolle::Prebuilt< Dim_, Index_, Float_ >.

◆ num_observations()

template<class Distance_ , typename Dim_ , typename Index_ , typename Store_ , typename Float_ >
Index_ knncolle::VptreePrebuilt< Distance_, Dim_, Index_, Store_, Float_ >::num_observations ( ) const
inlinevirtual
Returns
Number of observations in the dataset to be searched.

Implements knncolle::Prebuilt< Dim_, Index_, Float_ >.


The documentation for this class was generated from the following file: