knncolle
Collection of KNN methods in C++
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
knncolle::ManhattanDistance Struct Reference

Compute Manhattan distances between two input vectors. More...

#include <distances.hpp>

Static Public Member Functions

template<typename Output_ , typename DataX_ , typename DataY_ , typename Dim_ >
static Output_ raw_distance (const DataX_ *x, const DataY_ *y, Dim_ num_dimensions)
 
template<typename Output_ >
static Output_ normalize (Output_ raw)
 
template<typename Output_ >
static Output_ denormalize (Output_ norm)
 

Detailed Description

Compute Manhattan distances between two input vectors.

Member Function Documentation

◆ denormalize()

template<typename Output_ >
static Output_ knncolle::ManhattanDistance::denormalize ( Output_  norm)
inlinestatic
Template Parameters
Output_Floating point type for the distance.
Parameters
normNormalized distance.
Returns
norm with no modification.

◆ normalize()

template<typename Output_ >
static Output_ knncolle::ManhattanDistance::normalize ( Output_  raw)
inlinestatic
Template Parameters
Output_Floating point type for the distance.
Parameters
rawManhattan distance.
Returns
raw with no modification.

◆ raw_distance()

template<typename Output_ , typename DataX_ , typename DataY_ , typename Dim_ >
static Output_ knncolle::ManhattanDistance::raw_distance ( const DataX_ *  x,
const DataY_ *  y,
Dim_  num_dimensions 
)
inlinestatic
Parameters
xPointer to the array containing the first vector.
yPointer to the array containing the second vector.
num_dimensionsLength of both vectors.
Template Parameters
Output_Floating point type for the output distance.
DataX_Floating point type for the first data vector.
DataY_Floating point type for the second data vector.
Dim_Integer type for the vector length.
Returns
The Manhattan distance between x and y.

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