molframe-spatial 0.6.4

Deterministic spatial indices and neighbour search for molframe
Documentation
1
2
3
4
5
6
7
8
9
10
11
use super::PairColumns;
use crate::NeighborPair;

#[test]
fn columns_hold_indices_and_euclidean_distances() {
    let pairs = [NeighborPair::new(3, 1, 4.0), NeighborPair::new(0, 2, 9.0)];
    let columns = PairColumns::from_pairs(&pairs);
    assert_eq!(columns.first, [1, 0]);
    assert_eq!(columns.second, [3, 2]);
    assert_eq!(columns.distance, [2.0, 3.0]);
}