-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from azizkayumov/develop
fully-dynamic index
- Loading branch information
Showing
30 changed files
with
2,069 additions
and
837 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/target | ||
/Cargo.lock | ||
.DS_Store | ||
target | ||
Cargo.lock | ||
/demo/data/env | ||
.DS_Store |
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 |
---|---|---|
@@ -1,29 +1,7 @@ | ||
[package] | ||
name = "rindex" | ||
version = "0.1.0" | ||
edition = "2021" | ||
rust-version = "1.63" | ||
description = "Rindex: reverse nearest neighbor search index for high-dimensional clustered datasets." | ||
readme = "README.md" | ||
documentation = "https://docs.rs/rindex" | ||
homepage = "https://github.com/azizkayumov/rindex" | ||
repository = "https://github.com/azizkayumov/rindex" | ||
license = "Apache-2.0" | ||
keywords = ["tree", "dynamic-connectivity"] | ||
categories = ["algorithms", "data-structures"] | ||
authors = ["Kayumov A.I. <[email protected]>"] | ||
exclude = ["./github"] | ||
[workspace] | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
conv = "0.3.3" | ||
ordered-float = "4.1.1" | ||
|
||
[dev-dependencies] | ||
rand = "0.8" | ||
criterion = "0.5.1" | ||
|
||
[[bench]] | ||
name = "benchmark" | ||
harness = false | ||
members = [ | ||
"lib", | ||
"demo", | ||
] | ||
resolver = "2" |
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 |
---|---|---|
@@ -1,2 +1,8 @@ | ||
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/azizkayumov/rindex/ci.yml?style=plastic)](#) | ||
[![crates.io](https://img.shields.io/crates/v/rindex)](https://crates.io/crates/rindex) | ||
|
||
# rindex | ||
Rindex: reverse nearest neighbor search index for high-dimensional clustered datasets. | ||
Rindex: fully dynamic nearest neighbor search index for high-dimensional clustered datasets. | ||
|
||
## License | ||
This project is licensed under the [Apache License, Version 2.0](LICENSE.md) - See the [LICENSE.md](https://github.com/azizkayumov/rindex/blob/main/LICENSE) file for details. |
This file was deleted.
Oops, something went wrong.
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,10 @@ | ||
[package] | ||
name = "demo" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
rindex = { path = "../lib" } | ||
rand = "0.8" |
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,42 @@ | ||
import matplotlib.pyplot as plt | ||
|
||
|
||
# Read the data | ||
lines = open("tree.csv").readlines() | ||
|
||
points = {} | ||
bubbles = {} | ||
for row in lines: | ||
s = row.split(",") | ||
id = int(s[0]) | ||
height = int(s[1]) | ||
if height == 0: | ||
x, y = float(s[-2]), float(s[-1]) | ||
points[id] = (x, y) | ||
elif height == 1: | ||
radius = float(s[-3]) | ||
x, y = float(s[-2]), float(s[-1]) | ||
children = s[3].split("+") | ||
bubbles[id] = (x, y, radius, children) | ||
|
||
fig, ax = plt.subplots() | ||
colors = ['r', 'g', 'b', 'y', 'c', 'm'] | ||
for id, (x, y, radius, children) in bubbles.items(): | ||
color = colors[id % len(colors)] | ||
circle = plt.Circle((x, y), radius, color='b', alpha=0.25) | ||
ax.add_artist(circle) | ||
for child in children: | ||
child = int(child) | ||
x, y = points[child][0], points[child][1] | ||
plt.scatter(x, y, color='b', s=2, marker='+') | ||
|
||
# remove coordinate axis names | ||
plt.xticks([]) | ||
plt.yticks([]) | ||
plt.gca().set_aspect('equal') | ||
|
||
title = "N = " + str(len(points)) + ", L = " + str(len(bubbles)) | ||
plt.title(title) | ||
|
||
# set axis limits | ||
plt.savefig("tree.png", dpi=300) |
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,13 @@ | ||
contourpy==1.2.1 | ||
cycler==0.12.1 | ||
fonttools==4.53.1 | ||
importlib_resources==6.4.2 | ||
kiwisolver==1.4.5 | ||
matplotlib==3.9.2 | ||
numpy==2.0.1 | ||
packaging==24.1 | ||
pillow==10.4.0 | ||
pyparsing==3.1.2 | ||
python-dateutil==2.9.0.post0 | ||
six==1.16.0 | ||
zipp==3.20.0 |
Oops, something went wrong.