Exact brute-force K-NN without multi-threading.
Parameters |
Description |
srcData |
A matrix where each row is one vector of the original data. |
srcCompareData |
A matrix where each row is one vector. We want to find K vectors from srcData for each srcCompareData vector. |
K |
The number of nearest neighbours/rows from SrcData to find for each row in SrcCompareData. |
dstNearIdx |
Contains K indexes of rows from srcData for each row in SrcCompareData on output. The actual distances are stored in dstNearDistance parameter. |
dstNearDistance |
Contains K distance of rows from srcData for each row in SrcCompareData on output. The distances are not sorted. |
K-nearest-neighbours will be computing the square of L2-Norm (distance) between rows in srcData and rows in srcCompareData to find K nearest rows from srcData for each row in the srcCompareData matrix. The SrcData.Cols and SrcCompareData.Cols need to match in size or an exception will be raised. The sizes of dstNearIdx, dstNearDistance and dstNearLargestIdx are set automatically.
Performance notes:
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|