Calibration

Struct Calibration 

Source
pub struct Calibration<F> {
    pub slope: F,
    pub offset: F,
    pub rms: Option<F>,
    pub rsq: Option<F>,
}
Expand description

Calibration struct as a convenience wrapper.

This includes optional elements for goodness of fit variables. The calibration model is linear, i.e. $y = m x + c$

Fields§

§slope: F
§offset: F§rms: Option<F>§rsq: Option<F>

Implementations§

Source§

impl<F> Calibration<F>
where F: Copy,

Source

pub fn new( slope: F, offset: F, rms: Option<F>, rsq: Option<F>, ) -> Calibration<F>

Source

pub fn with_slope(&self, slope: F) -> Calibration<F>

Modifies the slope

Source

pub fn with_offset(&self, offset: F) -> Calibration<F>

Trait Implementations§

Source§

impl<'a, M: Copy + Default, F: Copy + ApproxEq<Margin = M>> ApproxEq for &'a Calibration<F>

Implements ApproxEq trait for Calibration struct

Source§

type Margin = M

This type type defines a margin within which two values are to be considered approximately equal. It must implement Default so that approx_eq() can be called on unknown types.
Source§

fn approx_eq<T: Into<Self::Margin>>(self, other: Self, margin: T) -> bool

This method tests that the self and other values are equal within margin of each other.
Source§

fn approx_ne<M>(self, other: Self, margin: M) -> bool
where M: Into<Self::Margin>,

This method tests that the self and other values are not within margin of each other.
Source§

impl<F> Default for Calibration<F>
where F: Default,

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<F> Freeze for Calibration<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for Calibration<F>
where F: RefUnwindSafe,

§

impl<F> Send for Calibration<F>
where F: Send,

§

impl<F> Sync for Calibration<F>
where F: Sync,

§

impl<F> Unpin for Calibration<F>
where F: Unpin,

§

impl<F> UnwindSafe for Calibration<F>
where F: 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.