fn assign_layers_impl_frac_1d<L: Ord>(
    positions: &[f64],
    threshold: f64,
    labels: Option<&[L]>,
) -> Result<Layers, Error>
{
    // dispatch to completely different algorithms; not much code can be reused
    match labels {
        Some(labels) => assign_layers_impl_frac_1d_with_labels(positions, threshold, labels),
        None => assign_layers_impl_frac_1d_no_labels(positions, threshold),
    }
}
// Given a sequence of positions `x`, each of which has periodic images
// with a period of 1, identify the layers that exist per unit cell.
Given a sequence of positions `x`, each of which has periodic images
with a period of 1, identify the layers that exist per unit cell.
Given a sequence of positions ` x ` each of which has periodic images with a period of 1 identify the layers that exist per unit cell .
fn assign_layers_impl_frac_1d<L: Ord>(
    positions: &[f64],
    threshold: f64,
    labels: Option<&[L]>,
) -> Result<Layers, Error>
{
    // dispatch to completely different algorithms; not much code can be reused
    match labels {
        Some(labels) => assign_layers_impl_frac_1d_with_labels(positions, threshold, labels),
        None => assign_layers_impl_frac_1d_no_labels(positions, threshold),
    }
}
fn assign_layers_impl_frac_1d < L : Ord > ( positions : & [ f64 ] , threshold : f64 , labels : Option < & [ L ] > , ) -> Result < Layers , Error > { // dispatch to completely different algorithms; not much code can be reused match labels { Some ( labels ) => assign_layers_impl_frac_1d_with_labels ( positions , threshold , labels ) , None => assign_layers_impl_frac_1d_no_labels ( positions , threshold ) , } }
Given a sequence of positions `x`, each of which has periodic images
with a period of 1, identify the layers that exist per unit cell.
Given a sequence of positions ` x ` each of which has periodic images with a period of 1 identify the layers that exist per unit cell .
positions
&[f64]
threshold
f64
labels
Option<&[L]>
positions
&[f64]
threshold
f64
labels
Option<&[L]>