pub fn accuracy<A, D, Sc>(
    mut teo: Sc,
    init: Array<A, D>,
    dt_base: A::Real,
    step_base: usize,
    num_scale: u32,
) -> Vec<(Sc::Time, A::Real)>
where
    A: Scalar + Lapack,
    D: Dimension,
    Sc: Scheme<Scalar = A, Dim = D, Time = A::Real>,
{
    let data: Vec<_> = (0..num_scale)
        .map(|n| {
            let rate = 2_usize.pow(n);
            let dt = dt_base / A::real(rate as f64);
            let t = step_base * rate;
            teo.set_dt(dt);
            (dt, iterate(&mut teo, init.clone(), t))
        })
        .collect();
    data.windows(2)
        .map(|w| {
            let dt = w[0].0;
            let dev = (&w[1].1 - &w[0].1).norm();
            (dt, dev)
        })
        .collect()
}
/// Test time accuracy of equation of motion
Test time accuracy of equation of motion
Test time accuracy of equation of motion
pub fn accuracy<A, D, Sc>(
    mut teo: Sc,
    init: Array<A, D>,
    dt_base: A::Real,
    step_base: usize,
    num_scale: u32,
) -> Vec<(Sc::Time, A::Real)>
where
    A: Scalar + Lapack,
    D: Dimension,
    Sc: Scheme<Scalar = A, Dim = D, Time = A::Real>,
{
    let data: Vec<_> = (0..num_scale)
        .map(|n| {
            let rate = 2_usize.pow(n);
            let dt = dt_base / A::real(rate as f64);
            let t = step_base * rate;
            teo.set_dt(dt);
            (dt, iterate(&mut teo, init.clone(), t))
        })
        .collect();
    data.windows(2)
        .map(|w| {
            let dt = w[0].0;
            let dev = (&w[1].1 - &w[0].1).norm();
            (dt, dev)
        })
        .collect()
}
pub fn accuracy < A , D , Sc > ( mut teo : Sc , init : Array < A , D > , dt_base : A :: Real , step_base : usize , num_scale : u32 , ) -> Vec < ( Sc :: Time , A :: Real ) > where A : Scalar + Lapack , D : Dimension , Sc : Scheme < Scalar = A , Dim = D , Time = A :: Real > , { let data : Vec < _ > = ( 0 .. num_scale ) . map ( | n | { let rate = 2_usize . pow ( n ) ; let dt = dt_base / A :: real ( rate as f64 ) ; let t = step_base * rate ; teo . set_dt ( dt ) ; ( dt , iterate ( & mut teo , init . clone ( ) , t ) ) } ) . collect ( ) ; data . windows ( 2 ) . map ( | w | { let dt = w [ 0 ] . 0 ; let dev = ( & w [ 1 ] . 1 - & w [ 0 ] . 1 ) . norm ( ) ; ( dt , dev ) } ) . collect ( ) }
Test time accuracy of equation of motion
Test time accuracy of equation of motion
teo
Sc
init
Array<A, D>
dt_base
A::Real
step_base
usize
num_scale
u32
teo
Sc
init
Array<A, D>
dt_base
A::Real
step_base
usize
num_scale
u32