MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / single_knn_data

Function single_knn_data

test/nearest_neighbour.cpp:362–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360 : public ::testing::TestWithParam<nearest_neighbors_params> {};
361
362nearest_neighbors_params single_knn_data(const string testname,
363 const int nquery, const int ntrain,
364 const int nfeat, const int k,
365 const int feat_dim) {
366 array indices, dists;
367 array query, train;
368 if (feat_dim == 0) {
369 query = constant(0, nfeat, nquery);
370 train = constant(1, nfeat, ntrain);
371 } else {
372 query = constant(0, nquery, nfeat);
373 train = constant(1, ntrain, nfeat);
374 }
375
376 indices = constant(0, k, nquery, u32);
377 dists = constant(nfeat, k, nquery);
378
379 return nearest_neighbors_params(testname, k, feat_dim, query, train,
380 indices, dists);
381}
382
383nearest_neighbors_params knn_data(const string testname, const int nquery,
384 const int ntrain, const int nfeat,

Callers 1

genNNTestsFunction · 0.85

Calls 2

constantFunction · 0.85

Tested by

no test coverage detected