Function fang_oost::get_density_x[][src]

pub fn get_density_x<T>(
    num_x: usize,
    num_u: usize,
    x_min: f64,
    x_max: f64,
    fn_inv: T
) -> impl IndexedParallelIterator<Item = f64> where
    T: Fn(&Complex<f64>) -> Complex<f64> + Sync + Send

Returns iterator over density with domain created by the function

Examples

extern crate num_complex;
use num_complex::Complex;
extern crate fang_oost;
let num_x = 1024;
let x_min = -20.0;
let x_max = 25.0;
let num_u = 256;
let mu = 2.0;
let sigma = 5.0;
let norm_cf = |u:&Complex<f64>|(u*mu+0.5*u*u*sigma*sigma).exp();
let density = fang_oost::get_density_x(
   num_x, num_u, x_min, x_max, &norm_cf
);