pub struct PeriodicKdTree<const D: usize> { /* private fields */ }Expand description
A k-d tree on a periodic box [0, L₁) × … × [0, L_D) (SciPy’s cKDTree(..., boxsize=L)):
distances are measured to the nearest periodic image, as in simulations with periodic
boundary conditions. Queries search the 3^D images of the query point.
Implementations§
Source§impl<const D: usize> PeriodicKdTree<D>
impl<const D: usize> PeriodicKdTree<D>
Sourcepub fn new(points: &[[f64; D]], boxsize: [f64; D]) -> Result<Self, ErrorsJSL>
pub fn new(points: &[[f64; D]], boxsize: [f64; D]) -> Result<Self, ErrorsJSL>
A tree on points inside the box (each coordinate in [0, Lₖ); others are wrapped in).
Sourcepub fn k_nearest(&self, query: [f64; D], k: usize) -> Vec<(usize, f64)>
pub fn k_nearest(&self, query: [f64; D], k: usize) -> Vec<(usize, f64)>
The k nearest points under the periodic distance, nearest first.
Sourcepub fn nearest(&self, query: [f64; D]) -> Option<(usize, f64)>
pub fn nearest(&self, query: [f64; D]) -> Option<(usize, f64)>
The nearest point under the periodic distance.
Trait Implementations§
Source§impl<const D: usize> Clone for PeriodicKdTree<D>
impl<const D: usize> Clone for PeriodicKdTree<D>
Auto Trait Implementations§
impl<const D: usize> Freeze for PeriodicKdTree<D>
impl<const D: usize> RefUnwindSafe for PeriodicKdTree<D>
impl<const D: usize> Send for PeriodicKdTree<D>
impl<const D: usize> Sync for PeriodicKdTree<D>
impl<const D: usize> Unpin for PeriodicKdTree<D>
impl<const D: usize> UnsafeUnpin for PeriodicKdTree<D>
impl<const D: usize> UnwindSafe for PeriodicKdTree<D>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more