Exact brute-force K-NN with support for symmetric and asymetric multi-threading.
Parameters |
Description |
computeThreads |
A TMtxFoorLoop object, which is a threading library. ComputeThreads.BlockGranularity is required to be set to 4 for this algorithm. Additionally this object allows the user to specify thread-count and thread-affinity etc.. |
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 (euclidian norm or the 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 and dstNearDistance are set automatically.
Performance notes:
Copyright (c) 1999-2025 by Dew Research. All rights reserved.
|
What do you think about this topic? Send feedback!
|