Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/common/generate_best_n_within.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ macro_rules! generate_best_n_within {
rd,
);

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if rd <= radius {
off[split_dim] = new_off;
Expand Down
4 changes: 2 additions & 2 deletions src/common/generate_nearest_n.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ macro_rules! generate_nearest_n {
rd,
);

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if Self::dist_belongs_in_heap(rd, results) {
off[split_dim] = new_off;
Expand Down Expand Up @@ -112,7 +112,7 @@ macro_rules! generate_nearest_n {
}
}

#[inline]
#[inline(always)]
fn dist_belongs_in_heap(dist: A, heap: &BinaryHeap<NearestNeighbour<A, T>>) -> bool {
heap.is_empty() || dist < heap.peek().unwrap().distance || heap.len() < heap.capacity()
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/generate_nearest_n_within_unsorted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ macro_rules! generate_nearest_n_within_unsorted {
rd,
);

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if rd <= radius {
off[split_dim] = new_off;
Expand Down Expand Up @@ -116,7 +116,7 @@ macro_rules! generate_nearest_n_within_unsorted {
.for_each(|(idx, entry)| {
let distance = D::dist(query, transform(entry));

if distance < radius {
if distance <= radius {
let item = unsafe { leaf_node.content_items.get_unchecked(idx) };
let item = *transform(item);

Expand Down
2 changes: 1 addition & 1 deletion src/common/generate_nearest_one.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ macro_rules! generate_nearest_one {
nearest = nearest_neighbour;
}

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if rd <= nearest.distance {
off[split_dim] = new_off;
Expand Down
4 changes: 2 additions & 2 deletions src/common/generate_within_unsorted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ macro_rules! generate_within_unsorted {
rd,
);

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if rd <= radius {
off[split_dim] = new_off;
Expand Down Expand Up @@ -98,7 +98,7 @@ macro_rules! generate_within_unsorted {
.for_each(|(idx, entry)| {
let distance = D::dist(query, transform(entry));

if distance < radius {
if distance <= radius {
let item = unsafe { leaf_node.content_items.get_unchecked(idx) };
let item = *transform(item);

Expand Down
4 changes: 2 additions & 2 deletions src/common/generate_within_unsorted_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ macro_rules! generate_within_unsorted_iter {
rd,
);

rd = Axis::rd_update(rd, D::dist1(new_off, old_off));
rd = D::accumulate(rd, D::dist1(new_off, old_off));

if rd <= radius {
off[split_dim] = new_off;
Expand Down Expand Up @@ -108,7 +108,7 @@ macro_rules! generate_within_unsorted_iter {
.for_each(|(idx, entry)| {
let distance = D::dist(query, transform(entry));

if distance < radius {
if distance <= radius {
let item = unsafe { leaf_node.content_items.get_unchecked(idx) };
let item = *transform(item);

Expand Down
Loading
Loading