// wrapper around the gamma_system_analysis module which handles all the newtype conversions
wrapper around the gamma_system_analysis module which handles all the newtype conversions
wrapper around the gamma_system_analysis module which handles all the newtype conversions
fn do_gamma_system_analysis(
    coords: &Coords,
    meta: HList5<
        meta::SiteElements,
        meta::SiteMasses,
        Option<meta::SiteLayers>,
        Option<meta::LayerScMatrices>,
        Option<meta::FracBonds>,
    >,
    freqs: &[f64],
    evecs: &GammaBasis3,
    mode_classifications: Option<Rc<[ModeKind]>>,
    // can set to false to forcibly disable this expensive operation even
    // if all necessary data is available
    unfold_bands: bool,
) -> FailResult<GammaSystemAnalysis> {
    use self::ev_analyses::*;
    // FIXME it would be nice if gamma_analysis used the same metadata types as this part
    //       of the code does...
    let hlist_pat![
        site_elements, site_masses, site_layers, layer_sc_matrices, frac_bonds,
    ] = meta;
    let cart_bonds = frac_bonds.as_ref().map(|b| b.to_cart_bonds(coords));
    gamma_system_analysis::Input {
        site_layers: site_layers,
        layer_sc_mats: layer_sc_matrices,
        site_masses: Some(site_masses.clone()),
        ev_classifications: mode_classifications.map(|x| EvClassifications(x.to_vec())),
        site_elements: Some(site_elements),
        site_coords: Some(coords.clone()),
        ev_frequencies: Some(EvFrequencies(freqs.to_vec())),
        ev_eigenvectors: Some(EvEigenvectors(evecs.clone())),
        bonds: cart_bonds.map(Bonds),
        request_to_unfold_bands: if unfold_bands { Some(RequestToUnfoldBands) } else { None },
    }.compute()
}
fn do_gamma_system_analysis ( coords : & Coords , meta : HList5 < meta :: SiteElements , meta :: SiteMasses , Option < meta :: SiteLayers > , Option < meta :: LayerScMatrices > , Option < meta :: FracBonds > , > , freqs : & [ f64 ] , evecs : & GammaBasis3 , mode_classifications : Option < Rc < [ ModeKind ] > > , // can set to false to forcibly disable this expensive operation even // if all necessary data is available unfold_bands : bool , ) -> FailResult < GammaSystemAnalysis > { use self :: ev_analyses :: * ; // FIXME it would be nice if gamma_analysis used the same metadata types as this part //       of the code does... let hlist_pat ! [ site_elements site_masses site_layers layer_sc_matrices frac_bonds ] = meta ; let cart_bonds = frac_bonds . as_ref ( ) . map ( | b | b . to_cart_bonds ( coords ) ) ; gamma_system_analysis :: Input { site_layers : site_layers , layer_sc_mats : layer_sc_matrices , site_masses : Some ( site_masses . clone ( ) ) , ev_classifications : mode_classifications . map ( | x | EvClassifications ( x . to_vec ( ) ) ) , site_elements : Some ( site_elements ) , site_coords : Some ( coords . clone ( ) ) , ev_frequencies : Some ( EvFrequencies ( freqs . to_vec ( ) ) ) , ev_eigenvectors : Some ( EvEigenvectors ( evecs . clone ( ) ) ) , bonds : cart_bonds . map ( Bonds ) , request_to_unfold_bands : if unfold_bands { Some ( RequestToUnfoldBands ) } else { None } , } . compute ( ) }
wrapper around the gamma_system_analysis module which handles all the newtype conversions
wrapper around the gamma_system_analysis module which handles all the newtype conversions
coords
&Coords
meta
HList5<
        meta::SiteElements,
        meta::SiteMasses,
        Option<meta::SiteLayers>,
        Option<meta::LayerScMatrices>,
        Option<meta::FracBonds>,
    >
freqs
&[f64]
evecs
&GammaBasis3
mode_classifications
Option<Rc<[ModeKind]>>
unfold_bands
bool