Skip to main content

lc_pairs_within_pbc

Function lc_pairs_within_pbc 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn lc_pairs_within_pbc( xyz: *const f64, n: usize, simbox: *const lc_cell, pbc: *const c_int, cutoff: f64, mask: *const c_int, cell_hint: f64, half: c_int, closed: c_int, exclude_self_images: c_int, out: *mut lc_pair, cap: usize, out_count: *mut usize, ) -> c_int
Expand description

lc_pairs_within_rows with a periodicity mask.

pbc is three ints. Nonzero means that axis is periodic. A null pbc is fully periodic. An open axis is binned on the occupied Cartesian cells and is not padded into a periodic box. closed nonzero keeps dist2 <= cutoff² on an open or mixed cell. exclude_self_images nonzero drops i == j.

Null out is a count query. Otherwise out holds cap rows. A query or a short buffer keeps its rows on the calling thread for the next call with the same inputs bit for bit.

§Safety

xyz is readable for n * 3 doubles. simbox, if any axis is periodic, points at one lc_cell. pbc, if non-null, is three ints. mask, if non-null, is n ints. out_count is writable. On a fill, out is writable for cap rows.