Skip to content

Commit

Permalink
Further fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Aug 12, 2024
1 parent 9fb555a commit 72cda36
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 50 deletions.
5 changes: 2 additions & 3 deletions src/generics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ SEXP generic_find_knn(

bool is_k_variable = false;
int const_k = 0;
std::vector<double> variable_k;
std::vector<int> variable_k;
if (num_neighbors.size() != 1 || force_variable_neighbors) {
is_k_variable = true;
if (static_cast<int>(num_neighbors.size()) != num_output) {
Expand Down Expand Up @@ -240,15 +240,14 @@ SEXP generic_query_knn(

bool is_k_variable = false;
int const_k = 0;
std::vector<double> variable_k;
std::vector<int> variable_k;
if (num_neighbors.size() != 1 || force_variable_neighbors) {
is_k_variable = true;
if (static_cast<int>(num_neighbors.size()) != nquery) {
throw std::runtime_error("length of 'k' must be equal to the number of points in the index or 'subset'");
}
variable_k.resize(nquery);
for (int o = 0; o < nquery; ++o) {
auto k = num_neighbors[o];
variable_k[o] = sanitize_k(num_neighbors[o]);
}
} else {
Expand Down
36 changes: 0 additions & 36 deletions src/l2norm.cpp

This file was deleted.

11 changes: 0 additions & 11 deletions src/l2norm.h

This file was deleted.

0 comments on commit 72cda36

Please sign in to comment.