Giter Club home page Giter Club logo

rust-octree's Introduction

This is my first crate for learning Rust.

Performance

test data: examples/data/3wu2.xyz, coordinates of 51053 particles extracted from a PDB file 3wu2 1

img

How to to reproduce

rust-octree (v0.0.6):

RAYON_NUM_THREADS=1 cargo run --example demo --release

scipy-ckdtree(v1.3.2):

ipython> edit scripts/bench.py
ipython> %timeit -n 10 run_test()

Related crates

References

Footnotes

1 https://www.rcsb.org/structure/3wu2

rust-octree's People

Contributors

ybyygu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

rust-octree's Issues

Two suggestions

Hi,

this looks almost what I need for my project. I skimmed through the source. Sadly two requirements do not seem fulfilled for my use case.

  1. move a point p1 to another point p2: tree.update(p1: Point,p2: Point) without rebuilding the whole octree (and of course also be able to remove it later).
  2. equip each Point with an id number in order to be later able to identify it in the results: for instance have a type Point like this: pub type Point = (f64, f64, f64, u64).

then you could write:

		pub type Point = (f64, f64, f64, u64);
		let mut points: Vec<Point> = Vec::new();
		points.push((5.0,2.0,8.0,101));//testdata
		points.push((10.0,3.0,2.0,1,205));//testdata
		points.push((10.0,13.0,12.0,48));//testdata
		points.push((10.0,3.0,2.0,3,10000));//testdata

		let mut tree = Octree::new(&points);
		tree.bucket_size = 8*8;
		tree.build();

		let x:Point = [0.0,0.0,0.0];
		let neighbors=tree.search(x,15.0);
		println!("{:?}",neighbors);

Output [(101, 9.643650760992955), (205, 10.63014581273465), (10000, 10.63014581273465)]

Is this something your library would support in future?

Points mutable problem with the current implmentation

Thank you for the crate. I just have a simple mutable reference problem.

As we can see Octree has a immutable reference to the points. Now say we have a simulation, where points will change their position with time. If the octree is active, then we will have a mutable reference problem, since octree has a mutable reference to the points and we are trying to update them.

How to deal with such a situation? Do you have any crate where you use this crate and solve did some simulation?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.