Skip to content

Commit

Permalink
Further fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Aug 9, 2024
1 parent b4771aa commit a5fea20
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions R/findNeighbors.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,14 @@ setMethod("findNeighbors", c("externalptr", "ANY"), function(X, threshold, get.i
num.threads <- BiocParallel::bpnworkers(BPPARAM)
}

if (is.null(subset)) {
output <- generic_find_all(X, thresholds=threshold, num_threads=num.threads, report_index=get.index, report_distance=get.distance)
} else {
output <- generic_find_all_subset(X, thresholds=threshold, chosen=subset, num_threads=num.threads, report_index=get.index, report_distance=get.distance)
}
output <- generic_find_all(
X,
thresholds=threshold,
chosen=subset,
num_threads=num.threads,
report_index=get.index,
report_distance=get.distance
)

if (!get.index && !get.distance) {
return(output)
Expand Down
2 changes: 1 addition & 1 deletion R/queryNeighbors.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ setMethod("queryNeighbors", c("externalptr", "ANY"), function(X, query, threshol

query <- .coerce_matrix_build(query, transposed)
if (!is.null(subset)) {
query <- query[,subset,drop=FALSE]
query <- query[,subset,drop=FALSE] # could move into C++ to avoid a copy but can't be bothered right now.
}

output <- generic_query_all(X, query=query, thresholds=threshold, num_threads=num.threads, report_index=get.index, report_distance=get.distance)
Expand Down

0 comments on commit a5fea20

Please sign in to comment.