Module kdtree_advanced

Module kdtree_advanced 

Source
Expand description

Advanced-optimized KD-Tree implementations with advanced performance features

This module provides state-of-the-art KD-Tree implementations optimized for modern hardware architectures. It includes cache-aware memory layouts, vectorized operations, NUMA-aware algorithms, and advanced query optimizations.

§Features

  • Cache-aware layouts: Memory layouts optimized for CPU cache hierarchies
  • Vectorized searches: SIMD-accelerated distance computations and comparisons
  • NUMA-aware construction: Optimized for multi-socket systems
  • Bulk operations: Batch queries with optimal memory access patterns
  • Memory pool integration: Reduces allocation overhead
  • Adaptive algorithms: Automatically adjusts to data characteristics
  • Lock-free parallel queries: Concurrent searches without synchronization overhead

§Examples

use scirs2_spatial::kdtree_advanced::{AdvancedKDTree, KDTreeConfig};
use scirs2_core::ndarray::array;

// Create advanced-optimized KD-Tree
let points = array![[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]];

let config = KDTreeConfig::new()
    .with_cache_aware_layout(true)
    .with_vectorized_search(true)
    .with_numa_aware(true);

let kdtree = AdvancedKDTree::new(&points.view(), config)?;

// Optimized k-nearest neighbors
let query = array![0.5, 0.5];
let (indices, distances) = kdtree.knn_search_advanced(&query.view(), 2)?;
println!("Nearest neighbors: {:?}", indices);

Structs§

AdvancedKDNode
Cache-optimized KD-Tree node layout
AdvancedKDTree
Advanced-optimized KD-Tree with advanced performance features
BoundingBox
Bounding box for search pruning
KDTreeConfig
Configuration for advanced-optimized KD-Tree
NodeInfo
Node information packed for cache efficiency
TreeStatistics
Tree construction and query statistics