Struct ReferenceIntervalWithSample

Source
pub struct ReferenceIntervalWithSample<T, F>
where T: Add<Output = T> + Sub<Output = T> + Copy, F: Float, StandardNormal: Distribution<F>,
{ pub reference_interval: ReferenceInterval<T>, pub mean: F, pub standard_deviation: F, pub normal: Normal<F>, }
Expand description

ReferenceIntervalWithSample decorates a ReferenceInterval with a random sample function, suitable for generating plausible ReferenceInterval normal values.

Fields§

§reference_interval: ReferenceInterval<T>§mean: F§standard_deviation: F§normal: Normal<F>

Implementations§

Source§

impl<T, F> ReferenceIntervalWithSample<T, F>
where T: Add<Output = T> + Sub<Output = T> + Copy + Into<F>, F: Float + NumCast, StandardNormal: Distribution<F>,

Source

pub fn new(reference_interval: ReferenceInterval<T>) -> Self

The new function is a builder that calculates the resource interval mean and standard deviation, then creates a normal distribution that is ready for the random sample function.

Trait Implementations§

Source§

impl<T, F> Distribution<F> for ReferenceIntervalWithSample<T, F>
where T: Add<Output = T> + Sub<Output = T> + Copy + Into<F>, F: Float + NumCast, StandardNormal: Distribution<F>,

Implement the typical rand sample function.

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> F

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> Map<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Map sampled values to type S Read more

Auto Trait Implementations§

§

impl<T, F> Freeze for ReferenceIntervalWithSample<T, F>
where F: Freeze, T: Freeze,

§

impl<T, F> RefUnwindSafe for ReferenceIntervalWithSample<T, F>

§

impl<T, F> Send for ReferenceIntervalWithSample<T, F>
where F: Send, T: Send,

§

impl<T, F> Sync for ReferenceIntervalWithSample<T, F>
where F: Sync, T: Sync,

§

impl<T, F> Unpin for ReferenceIntervalWithSample<T, F>
where F: Unpin, T: Unpin,

§

impl<T, F> UnwindSafe for ReferenceIntervalWithSample<T, F>
where F: UnwindSafe, T: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V