[−][src]Module gkquad::single
feature="single"
only.Performs 1-dimentional numerical integration
Examples
In order to calculate the simple integral, you can use integral
function.
use gkquad::single::integral; // calculate the integral over interval (0.0, 1.0) let result = integral(|x: f64| x.sin() * (- x * x).exp(), 0.0..1.0) .estimate() .unwrap();
If you want to calculate more complicated integral, you can use Integrator
object.
use std::f64::{INFINITY, NEG_INFINITY}; use gkquad::single::Integrator; use gkquad::single::algorithm::QAGP; // calculate the integral over interval (-∞, ∞), with QAGP algorithm, // maximum iteration limit being 100, singular point on the origin of coordinate. let result = Integrator::new(|x: f64| 1. - (-(x.abs() / 1.6).powf(-2.3)).exp(), QAGP::new()) .limit(100) .points(&[0.]) .run(NEG_INFINITY..INFINITY) .estimate() .unwrap();
Modules
algorithm | feature="single" Algorithms for 1-dimentional numerical integration |
Structs
IntegrationConfig | feature="single" Integration configuration |
Integrator | feature="single" Integration Executor |
Interval | feature="single" Represent the interval for which the integral is estimated. |
QKResult | feature="single" holds the result of Gauss-Kronrod integration |
Traits
Integrand | feature="single" The function that is to be integrated |
Functions
integral | feature="single" Performs integration using |
integral_with_config | feature="single" Performs the integration with custom configuration. |
qk17 | feature="single" Performs Gauss-Kronrod integration with 17-point kronrod rule |
qk25 | feature="single" Performs Gauss-Kronrod integration with 25-point kronrod rule |
qk33 | feature="single" Performs Gauss-Kronrod integration with 33-point kronrod rule |
qk41 | feature="single" Performs Gauss-Kronrod integration with 41-point kronrod rule |
qk49 | feature="single" Performs Gauss-Kronrod integration with 49-point kronrod rule |
qk57 | feature="single" Performs Gauss-Kronrod integration with 57-point kronrod rule |
Type Definitions
Points | feature="single" Singular points |