-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fuzzy test and Readme; solves #18
- Loading branch information
1 parent
4fd7cef
commit 92ad12b
Showing
8 changed files
with
442 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# KD-Tree implementation | ||
|
||
Implements only functions required for searching an already initialized KD-Tree. | ||
Because of this, this crate is no_std compatible | ||
|
||
Code for building the KD-Tree can be found in `kd_tree_sort`. | ||
`kd_tree_sort` is not no_std compatible which is why these two crates were seperated. | ||
A fuzzy tester as well as a benchmark verifying this implementation can be found in `kd_tree_sort`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# KD-Tree sort implemention | ||
|
||
Implements a non-no_std compatible sort function for usage with the `kd_tree` crate. | ||
|
||
## Benchmark | ||
For benchmarking purposed, criterion.rs was used, comparing our kd-tree against a basic linear_search. | ||
|
||
Run: `cargo bench` in this directory. | ||
|
||
## Fuzzy Test | ||
The implemented fuzzy test uses `cargo fuzz` | ||
Install it before running the fuzzy test (a nightly toolchain may be required). | ||
|
||
It compares the result of the linear search algorithm against the result of the kd-tree search. | ||
The fuzzy test input is filtering out `Inf` and `NaN` values since our kd-tree is | ||
supposed to find the nearest-neighbor on valid input data only. | ||
|
||
For starting the fuzzy test run: `cargo fuzz run kd_tree_search --sanitizer=leak` in this directory. | ||
*Note: the fuzzy test will run until it finds an error* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
target | ||
corpus | ||
artifacts |
Oops, something went wrong.