ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
knncpp::HammingDistance< Scalar > Struct Template Reference

#include <knncpp.h>

Classes

struct  BitCount
 
struct  XOR
 

Public Member Functions

template<typename DerivedA , typename DerivedB >
Scalar operator() (const Eigen::MatrixBase< DerivedA > &lhs, const Eigen::MatrixBase< DerivedB > &rhs) const
 
Scalar operator() (const Scalar lhs, const Scalar rhs) const
 
Scalar operator() (const Scalar value) const
 

Detailed Description

template<typename Scalar>
struct knncpp::HammingDistance< Scalar >

Hamming distance functor. The distance vectors have to be of integral type and should hold the information vectors as bitmasks. Performs a XOR operation on the vectors and counts the number of set ones.

Definition at line 197 of file knncpp.h.

Member Function Documentation

◆ operator()() [1/3]

template<typename Scalar >
template<typename DerivedA , typename DerivedB >
Scalar knncpp::HammingDistance< Scalar >::operator() ( const Eigen::MatrixBase< DerivedA > &  lhs,
const Eigen::MatrixBase< DerivedB > &  rhs 
) const
inline

Compute the unrooted distance between two vectors.

Parameters
lhsvector on left hand side
rhsvector on right hand side

Definition at line 224 of file knncpp.h.

References XOR.

◆ operator()() [2/3]

template<typename Scalar >
Scalar knncpp::HammingDistance< Scalar >::operator() ( const Scalar  lhs,
const Scalar  rhs 
) const
inline

Compute the unrooted distance between two scalars.

Parameters
lhsscalar on left hand side
rhsscalar on right hand side

Definition at line 239 of file knncpp.h.

◆ operator()() [3/3]

template<typename Scalar >
Scalar knncpp::HammingDistance< Scalar >::operator() ( const Scalar  value) const
inline

Compute the root of a unrooted distance value.

Parameters
valueunrooted distance value

Definition at line 247 of file knncpp.h.


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