#include "xf_data_analytics/geospatial/knn.hpp"
template < int CSV_PU_NUM = 2, int MAX_SORT_NUM = 8 > void knn ( ap_uint <128>* csv_buf, ap_uint <8>* schema, float base_x, float base_y, int k, float* sorted_dist_buf, uint32_t* sorted_idx_buf )
K Nearest Neighbors(KNN): find nearest-K points for a given base point.
Parameters:
CSV_PU_NUM | num of csv parser core used to parallel parse csv data, only support 2/4/8 |
MAX_SORT_NUM | the max number of the sequence can be sorted, should be less than 1024 |
csv_buf | input csv data |
schema | input csv schema |
base_x | base point x coordinate |
base_y | base point y coordinate |
k | num of nearest point, k <= MAX_SORT_NUM |
sorted_dist_buf | output distance of nearest-K points |
sorted_idx_buf | output index of nearest-K points |