Compute Euclidean distances between two input vectors.
More...
#include <distances.hpp>
|
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) |
|
Compute Euclidean distances between two input vectors.
◆ denormalize()
template<typename Output_ >
static Output_ knncolle::EuclideanDistance::denormalize |
( |
Output_ |
norm | ) |
|
|
inlinestatic |
- Template Parameters
-
Output_ | Floating point type for the output distance. |
- Parameters
-
- 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
-
raw | Squared 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
-
x | Pointer to the array containing the first vector. |
y | Pointer to the array containing the second vector. |
num_dimensions | Length 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: