[][src]Function fang_oost::get_density

pub fn get_density<'a, 'b: 'a, S>(
    x_min: f64,
    x_max: f64,
    x_domain_iterator: S,
    fn_inv_vec: &'b [Complex<f64>]
) -> impl IndexedParallelIterator<Item = f64> + 'a where
    S: IndexedParallelIterator<Item = f64> + Sync + 'b, 

Returns iterator over density with domain created by the function

Examples

extern crate num_complex;
extern crate fang_oost;
extern crate rayon;
use rayon::prelude::*;
use num_complex::Complex;
 
let num_x = 1024;
let num_u = 256;
let x_min = -20.0;
let x_max = 25.0;
let mu=2.0;
let sigma:f64=5.0;
let norm_cf = |u:&Complex<f64>|(u*mu+0.5*u*u*sigma*sigma).exp();
let x_domain=fang_oost::get_x_domain(num_x, x_min, x_max);
let discrete_cf=fang_oost::get_discrete_cf(num_u, x_min, x_max, &norm_cf);
let density:Vec<f64> = fang_oost::get_density(
   x_min, x_max, x_domain, &discrete_cf
).collect();