knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ > Class Template Referencefinal

Wrapper around a matrix with L2 normalization. More...

#include <L2Normalized.hpp>

Inheritance diagram for knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >:
Collaboration diagram for knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >:

Public Member Functions

std::size_t num_dimensions () const
 
Index_ num_observations () const
 
auto new_known_extractor () const
 
std::unique_ptr< MatrixExtractor< Normalized_ > > new_extractor () const
 
- Public Member Functions inherited from knncolle::Matrix< Index_, Normalized_ >
auto new_known_extractor () const
 

Detailed Description

template<typename Index_, typename Data_, typename Normalized_, typename Matrix_ = Matrix<Index_, Data_>>
class knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >

Wrapper around a matrix with L2 normalization.

Template Parameters
Index_Integer type for the indices.
Data_Numeric type for the original matrix data.
Normalized_Floating-point type for the L2-normalized data.
Matrix_Class of the input data matrix. This should satisfy the Matrix interface.

This class satisfies the Matrix interface and performs L2 normalization of each observation's data vector in its implementation of MatrixExtractor::next(). It is mainly intended for use within L2NormalizedBuilder. In general, users should not be manually constructing an instance of this class.

Member Function Documentation

◆ new_extractor()

template<typename Index_ , typename Data_ , typename Normalized_ , typename Matrix_ = Matrix<Index_, Data_>>
std::unique_ptr< MatrixExtractor< Normalized_ > > knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >::new_extractor ( ) const
inlinevirtual
Returns
A new consecutive-access extractor.

Implements knncolle::Matrix< Index_, Normalized_ >.

◆ new_known_extractor()

template<typename Index_ , typename Data_ , typename Normalized_ , typename Matrix_ = Matrix<Index_, Data_>>
auto knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >::new_known_extractor ( ) const
inline

Override to assist devirtualization.

◆ num_dimensions()

template<typename Index_ , typename Data_ , typename Normalized_ , typename Matrix_ = Matrix<Index_, Data_>>
std::size_t knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >::num_dimensions ( ) const
inlinevirtual
Returns
Number of dimensions.

Implements knncolle::Matrix< Index_, Normalized_ >.

◆ num_observations()

template<typename Index_ , typename Data_ , typename Normalized_ , typename Matrix_ = Matrix<Index_, Data_>>
Index_ knncolle::L2NormalizedMatrix< Index_, Data_, Normalized_, Matrix_ >::num_observations ( ) const
inlinevirtual
Returns
Number of observations.

Implements knncolle::Matrix< Index_, Normalized_ >.


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