pub struct CellList<'a> { /* private fields */ }Expand description
Fixed-radius grid built in O(n) with one contiguous member array.
Implementations§
Source§impl<'a> CellList<'a>
impl<'a> CellList<'a>
Sourcepub fn build_in(
positions: &'a [[f32; 3]],
targets: &[u32],
cutoff: f32,
periodic: Option<PeriodicBox>,
options: CellGridOptions,
context: &ExecutionContext,
) -> Result<Self, SpatialError>
pub fn build_in( positions: &'a [[f32; 3]], targets: &[u32], cutoff: f32, periodic: Option<PeriodicBox>, options: CellGridOptions, context: &ExecutionContext, ) -> Result<Self, SpatialError>
Builds an index whose construction peak and retained buffers share the execution account. Dropping the index releases its retained charge.
§Errors
Returns invalid geometry, cancellation or memory admission errors before allocating the grid buffers.
Source§impl<'a> CellList<'a>
impl<'a> CellList<'a>
Sourcepub fn build(
positions: &'a [[f32; 3]],
targets: &[u32],
cutoff: f32,
periodic: Option<PeriodicBox>,
) -> Result<Self, SpatialError>
pub fn build( positions: &'a [[f32; 3]], targets: &[u32], cutoff: f32, periodic: Option<PeriodicBox>, ) -> Result<Self, SpatialError>
Sourcepub fn build_with_options(
positions: &'a [[f32; 3]],
targets: &[u32],
cutoff: f32,
periodic: Option<PeriodicBox>,
options: CellGridOptions,
) -> Result<Self, SpatialError>
pub fn build_with_options( positions: &'a [[f32; 3]], targets: &[u32], cutoff: f32, periodic: Option<PeriodicBox>, options: CellGridOptions, ) -> Result<Self, SpatialError>
Builds an index under an explicit cell-grid memory policy.
§Errors
Returns an error for invalid options, cutoff or target index.
Sourcepub fn pairs(
&self,
query: &[u32],
cutoff: f32,
) -> Result<Vec<NeighborPair>, SpatialError>
pub fn pairs( &self, query: &[u32], cutoff: f32, ) -> Result<Vec<NeighborPair>, SpatialError>
Finds pairs for the indexed targets.
§Errors
Returns an error when the requested cutoff exceeds the build cutoff or a query index is out of range.
Sourcepub fn for_each_candidate(
&self,
query: &[u32],
cutoff: f32,
emit: impl FnMut(u32, u32, f32),
) -> Result<(), SpatialError>
pub fn for_each_candidate( &self, query: &[u32], cutoff: f32, emit: impl FnMut(u32, u32, f32), ) -> Result<(), SpatialError>
Visits oriented query-target candidates without retaining pairs.
Self-pairs are omitted. Overlapping query and target sets may emit both orientations; callers computing symmetric results must choose ownership.
§Errors
Returns invalid query indices or a cutoff larger than the indexed cutoff.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CellList<'a>
impl<'a> RefUnwindSafe for CellList<'a>
impl<'a> Send for CellList<'a>
impl<'a> Sync for CellList<'a>
impl<'a> Unpin for CellList<'a>
impl<'a> UnsafeUnpin for CellList<'a>
impl<'a> UnwindSafe for CellList<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more