Skip to main content

QuadratureSolution

Struct QuadratureSolution 

Source
pub struct QuadratureSolution { /* private fields */ }
Expand description

The outcome of a single quadrature lane.

The fields are private on purpose, on the same reasoning as OdeLaneSolution: Self::value returns Option<f64> and hands back Some only for a lane that ran to completion, while the raw number is behind the deliberately-named Self::last_value.

Copy, so it can be read out of a QuadratureBatch without cloning.

§Units

Self::value, Self::last_value and Self::error_estimate are in the integral’s units (integrand times abscissa); Self::evaluations is a dimensionless count.

Implementations§

Source§

impl QuadratureSolution

Source

pub fn value(&self) -> Option<f64>

The integral, if this lane ran to completion.

None for every failure status. This is the accessor to reach for; the Option is the point.

Source

pub fn last_value(&self) -> f64

The last value the rule accumulated, complete or not.

The integral only when Self::status is QuadratureStatus::Evaluated. For QuadratureStatus::ToleranceNotMet this is the best estimate the adaptive lane reached and is offered for diagnosis — for deciding whether the lane was close or wildly off. For the other two statuses it is NaN, because there is no honest number to report.

Source

pub fn error_estimate(&self) -> f64

Estimated absolute error, in the integral’s units.

Meaningful only for adaptive_quadrature_batch, where it is the summed Richardson estimate |S_2 - S_1| / 15 over the accepted sub-intervals. NaN for every fixed QuadratureRule, because a fixed rule has no error estimate to give and returning 0.0 would be a falsehood.

Source

pub fn evaluations(&self) -> u32

Integrand evaluations this lane performed, dimensionless.

Fixed and predictable for a QuadratureRule; data-dependent for the adaptive path, where it is the honest measure of how hard the integrand was and the source of the load imbalance work-stealing exists to absorb.

Source

pub fn status(&self) -> QuadratureStatus

How this lane ended.

Source

pub fn evaluated(&self) -> bool

Whether this lane produced a usable value.

Trait Implementations§

Source§

impl Clone for QuadratureSolution

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for QuadratureSolution

Source§

impl Debug for QuadratureSolution

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for QuadratureSolution

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QuadratureSolution

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.