Skip to main content

sign_changes

Function sign_changes 

Source
pub fn sign_changes<I: IntoIterator, F>(
    samples: I,
    side: F,
) -> SignChanges<I::IntoIter, F> ⓘ
Expand description

The pairs of neighbouring samples of samples that side puts on different sides, in order, each with the side of its first: brackets of a crossing. side says which side a sample lies on (< cut against <= 0, a sign of a number or of an interval: the caller’s choice), or None where it cannot tell; such a sample is passed over, its neighbours paired across it. Lazy: a scan for the first crossing asks no sample past it. SignChanges::bisected bisects each bracket.