Skip to main content

Crate spatialrust_search

Crate spatialrust_search 

Source
Expand description

Spatial search structures for SpatialRust.

KDTree, hash grid, and octree implementations live in this crate.

Structs§

BruteForceIndex
Reference index using brute-force search for correctness tests.
KdTree
Cache-friendly KD-tree for 3D point clouds.
Neighbor
One neighbor search result.
NeighborGraph
A directed neighborhood graph over a point cloud.

Constants§

MAX_UNIFORM_GRID_CELLS
Upper bound on dense grid cells; callers should fall back when exceeded.
PARALLEL_CHUNK_QUERY_MIN_POINTS
Minimum point count before threaded chunk dispatch is used.
PARALLEL_STAGING_MIN_POINTS
Minimum point count before multi-threaded index staging is used.

Traits§

ChunkedNearestNeighborIndex
k-NN search over contiguous query index ranges.
ChunkedRadiusSearchIndex
Radius search over contiguous query index ranges.
NearestNeighborIndex
Exact nearest neighbor queries.
RadiusSearchIndex
Radius search queries.
SpatialIndex
Common spatial index operations.

Functions§

brute_force_knn
Finds up to k nearest neighbors by brute force.
brute_force_radius
Finds all neighbors within radius by brute force.
build_grid
Counting-sort points into grid cells, returning sorted indices and CSR offsets.
euclidean_cluster_roots
Connected-component roots via uniform-grid union-find (minimum index per component).
euclidean_cluster_roots_from_segments
Computes Euclidean component roots from pre-built sparse grid segments.
grid_bounds
Returns grid origin (min corner) and cell counts for cell size radius.
knn_graph
Builds a directed k-nearest-neighbor graph: an edge from every point to each of its k nearest neighbors (excluding itself).
nearest_k_spatial_tensor
Runs k-NN search for every chunk in a SpatialTensor, appending tagged neighbors.
nearest_k_spatial_tensor_parallel
Parallel k-NN search over SpatialTensor chunks.
nearest_k_spatial_tensor_parallel_into
Parallel k-NN search, appending (query_index, neighbor) pairs to out.
parallel_index_for_each
Runs work over disjoint index ranges using parallel_worker_count.
parallel_index_ranges
Returns disjoint half-open index ranges covering [0, point_count).
parallel_worker_count
Returns the number of worker threads to use for point_count points.
parallel_worker_count_with_chunk
Returns the number of worker threads for an explicit staging chunk size.
radius_graph
Builds a directed radius graph: an edge from every point to each other point within radius.
radius_search_spatial_tensor
Runs radius search for every chunk in a SpatialTensor, appending tagged neighbors.
radius_search_spatial_tensor_parallel
Parallel radius search over SpatialTensor chunks.
radius_search_spatial_tensor_parallel_into
Parallel radius search, appending (query_index, neighbor) pairs to out.
uniform_grid_fits
Returns whether a uniform grid with the given cell size fits within the cell cap.

Type Aliases§

ChunkQueryRange
Range of query point indices (matches SpatialTensor::chunks ranges).