fn do_force_sets_at_disps_for_sparse(
    pot: &dyn PotentialBuilder,
    _threading: &cfg::Threading,
    displacements: &[(usize, V3)],
    coords: &Coords,
    meta: CommonMeta,
) -> FailResult<Vec<BTreeMap<usize, V3>>>
{Ok({
    use std::io::prelude::*;

    trace!("Computing forces at displacements");

    let mut disp_fn = pot.initialize_disp_fn(&coords, meta.sift())?;

    // this no longer has the option of using rayon because the speed gain from
    // disabling neighbor list updates in LAMMPS is far greater
    let force_sets = {
        displacements.iter()
            .enumerate()
            .map(|(i, &disp)| {
                eprint!("\rdisp {} of {}", i + 1, displacements.len());
                std::io::stderr().flush().unwrap();

                disp_fn.compute_sparse_force_delta(disp)
            })
            .collect::<Result<_, _>>()?
    };
    eprintln!();
    trace!("Done computing forces at displacements");
    force_sets
})}
// FIXME: rename.
//
// Also notice that the rsp2 eigensolver apparently never did disps in parallel,
// because I wanted to make it reuse the DispFn.
rename.
Also notice that the rsp2 eigensolver apparently never did disps in parallel,
because I wanted to make it reuse the DispFn.
rename . Also notice that the rsp2 eigensolver apparently never did disps in parallel because I wanted to make it reuse the DispFn .
fn do_force_sets_at_disps_for_sparse(
    pot: &dyn PotentialBuilder,
    _threading: &cfg::Threading,
    displacements: &[(usize, V3)],
    coords: &Coords,
    meta: CommonMeta,
) -> FailResult<Vec<BTreeMap<usize, V3>>>
{Ok({
    use std::io::prelude::*;
    trace!("Computing forces at displacements");
    let mut disp_fn = pot.initialize_disp_fn(&coords, meta.sift())?;
    // this no longer has the option of using rayon because the speed gain from
    // disabling neighbor list updates in LAMMPS is far greater
    let force_sets = {
        displacements.iter()
            .enumerate()
            .map(|(i, &disp)| {
                eprint!("\rdisp {} of {}", i + 1, displacements.len());
                std::io::stderr().flush().unwrap();
                disp_fn.compute_sparse_force_delta(disp)
            })
            .collect::<Result<_, _>>()?
    };
    eprintln!();
    trace!("Done computing forces at displacements");
    force_sets
})}
fn do_force_sets_at_disps_for_sparse ( pot : & dyn PotentialBuilder , _threading : & cfg :: Threading , displacements : & [ ( usize , V3 ) ] , coords : & Coords , meta : CommonMeta , ) -> FailResult < Vec < BTreeMap < usize , V3 > > > { Ok ( { use std :: io :: prelude :: * ; trace ! ( " " ) ; let mut disp_fn = pot . initialize_disp_fn ( & coords , meta . sift ( ) ) ? ; // this no longer has the option of using rayon because the speed gain from // disabling neighbor list updates in LAMMPS is far greater let force_sets = { displacements . iter ( ) . enumerate ( ) . map ( | ( i , & disp ) | { eprint ! ( " \r " i 1 displacements len ( ) ) ; std :: io :: stderr ( ) . flush ( ) . unwrap ( ) ; disp_fn . compute_sparse_force_delta ( disp ) } ) . collect :: < Result < _ , _ > > ( ) ? } ; eprintln ! ( ) ; trace ! ( " " ) ; force_sets } ) }
FIXME: rename.
FIXME : rename .
pot
&dyn PotentialBuilder
_threading
&cfg::Threading
displacements
&[(usize, V3)]
coords
&Coords
meta
CommonMeta
pot
&dyn PotentialBuilder
_threading
&cfg::Threading
displacements
&[(usize, V3)]
coords
&Coords
meta
CommonMeta