pub enum ModelParams {
Constant {
offset: f64,
},
Logarithmic {
gain: f64,
offset: f64,
},
Linear {
gain: f64,
offset: f64,
},
Linearithmic {
gain: f64,
offset: f64,
},
Quadratic {
gain: f64,
offset: f64,
},
Cubic {
gain: f64,
offset: f64,
},
Polynomial {
gain: f64,
power: f64,
},
Exponential {
gain: f64,
base: f64,
},
}Expand description
Coefficients of a fitted approximation function.
Each variant carries exactly the parameters its shape has, so a fitted polynomial always has an exponent and a fitted line never carries an unused one. There is no representable fit with a parameter missing.
Variants§
Constant
f(x) = offset
Logarithmic
f(x) = gain * ln(x) + offset
Linear
f(x) = gain * x + offset
Linearithmic
f(x) = gain * x * ln(x) + offset
Quadratic
f(x) = gain * x^2 + offset
Cubic
f(x) = gain * x^3 + offset
Polynomial
f(x) = gain * x^power
Fields
Exponential
f(x) = gain * base^x
Implementations§
Trait Implementations§
Source§impl Clone for ModelParams
impl Clone for ModelParams
Source§fn clone(&self) -> ModelParams
fn clone(&self) -> ModelParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ModelParams
Source§impl Debug for ModelParams
impl Debug for ModelParams
Source§impl<'de> Deserialize<'de> for ModelParams
impl<'de> Deserialize<'de> for ModelParams
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ModelParams
impl PartialEq for ModelParams
Source§impl Serialize for ModelParams
impl Serialize for ModelParams
impl StructuralPartialEq for ModelParams
Auto Trait Implementations§
impl Freeze for ModelParams
impl RefUnwindSafe for ModelParams
impl Send for ModelParams
impl Sync for ModelParams
impl Unpin for ModelParams
impl UnsafeUnpin for ModelParams
impl UnwindSafe for ModelParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more