pub enum ComputeMethod {
RectangleLeft,
RectangleRight,
Trapezoid,
Simpson,
Boole {
force: bool,
},
Romberg {
max_steps: usize,
},
MonteCarlo {
n_sample: usize,
},
}
Expand description
Numerical integration method enum
§Note on computations
For the considered integral to be consistent across compute methods for a given description, the left-rectangle (resp. right-rectangle) has to ignore the last (resp. first) value given in the descriptors. This can be visualized in the following example:
Out of 11 samples, both methods compute the area of 10 polygons. In the case where the domain is uniform & described using a step, the eleventh sample value is useless (for a left-rectangle method).
The crate assumes that the first and last samples making up your domain corresponds to the limits of the integral. Therefore, these values will be ignored when computing the integral using rectangles.
Variants§
RectangleLeft
Rectangle method, using the left rule – reference
RectangleRight
Rectangle method, using the right rule – reference
Trapezoid
Trapezoid method – reference
Simpson
Simpson’s rule(s), the exact rule applied depends on integral definition – reference
Boole
boole
only.Boole’s method – reference
Romberg
romberg
only.Romberg’s method – reference
MonteCarlo
montecarlo
only.Monte-Carlo method – reference
Trait Implementations§
Source§impl Clone for ComputeMethod
impl Clone for ComputeMethod
Source§fn clone(&self) -> ComputeMethod
fn clone(&self) -> ComputeMethod
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more