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

Compute Euclidean 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 Euclidean distances between two input vectors.

Member Function Documentation

◆ denormalize()

template<typename Output_ >
static Output_ knncolle::EuclideanDistance::denormalize ( Output_  norm)
inlinestatic
Template Parameters
Output_Floating point type for the output distance.
Parameters
normEuclidean distance.
Returns
Squared Euclidean distance.

◆ normalize()

template<typename Output_ >
static Output_ knncolle::EuclideanDistance::normalize ( Output_  raw)
inlinestatic
Template Parameters
Output_Floating point type for the output distance.
Parameters
rawSquared Euclidean distance.
Returns
Euclidean distance.

◆ raw_distance()

template<typename Output_ , typename DataX_ , typename DataY_ , typename Dim_ >
static Output_ knncolle::EuclideanDistance::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 squared Euclidean distance between x and y.

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