integrate

Function integrate 

Source
pub fn integrate<F>(
    f: F,
    bounds: &[(f64, f64)],
    n_samples: usize,
) -> Result<IntegrationResult>
where F: Fn(&[f64]) -> f64 + Sync,
Expand description

Performs Monte Carlo integration

§Arguments

  • f - The function to integrate
  • bounds - Integration bounds for each dimension [(min, max), …]
  • n_samples - Number of random samples to use

§Returns

Integration result with estimate and error