pub struct Parameter { /* private fields */ }Expand description
Complete definition and user-facing metadata for one scalar parameter.
Implementations§
Source§impl Parameter
impl Parameter
Sourcepub fn free(name: impl Into<Arc<str>>) -> Self
pub fn free(name: impl Into<Arc<str>>) -> Self
Creates an unbounded free parameter with a default initial value.
Sourcepub fn fixed(name: impl Into<Arc<str>>, value: f64) -> Self
pub fn fixed(name: impl Into<Arc<str>>, value: f64) -> Self
Creates an unbounded parameter fixed at value.
Sourcepub fn with_fixed_value(self, value: f64) -> Self
pub fn with_fixed_value(self, value: f64) -> Self
Returns this parameter fixed at value.
Sourcepub fn with_initial(self, initial: impl Into<InitialSpec>) -> Self
pub fn with_initial(self, initial: impl Into<InitialSpec>) -> Self
Returns this parameter with the specified initialization rule.
Sourcepub fn with_bounds(
self,
min: impl Into<Option<f64>>,
max: impl Into<Option<f64>>,
) -> Self
pub fn with_bounds( self, min: impl Into<Option<f64>>, max: impl Into<Option<f64>>, ) -> Self
Returns this parameter with inclusive optional bounds.
Sourcepub fn with_periodic(self) -> Self
pub fn with_periodic(self) -> Self
Mark this parameter as periodic over its finite two-sided bounds.
Sourcepub fn with_periodicity(self, periodic: bool) -> Self
pub fn with_periodicity(self, periodic: bool) -> Self
Sets whether the parameter is periodic.
Sourcepub fn with_scale(self, scale: f64) -> Self
pub fn with_scale(self, scale: f64) -> Self
Set the characteristic optimizer scale for this parameter.
The scale is metadata: fit integrations may use it to condition the optimizer coordinate system, while direct model evaluation is unchanged.
Sourcepub fn with_unit(self, unit: impl Into<Arc<str>>) -> Self
pub fn with_unit(self, unit: impl Into<Arc<str>>) -> Self
Attaches a human-readable unit label.
Sourcepub fn with_latex(self, latex: impl Into<Arc<str>>) -> Self
pub fn with_latex(self, latex: impl Into<Arc<str>>) -> Self
Attaches a LaTeX-formatted label.
Sourcepub fn with_description(self, description: impl Into<Arc<str>>) -> Self
pub fn with_description(self, description: impl Into<Arc<str>>) -> Self
Attaches a longer human-readable description.
Sourcepub fn state(&self) -> &ParamState
pub fn state(&self) -> &ParamState
Returns whether the parameter is free or fixed.
Sourcepub fn initial_spec(&self) -> &InitialSpec
pub fn initial_spec(&self) -> &InitialSpec
Returns the initialization rule.
Sourcepub fn bounds_spec(&self) -> &Bounds
pub fn bounds_spec(&self) -> &Bounds
Returns the optional parameter bounds.
Sourcepub fn is_periodic(&self) -> bool
pub fn is_periodic(&self) -> bool
Returns whether the parameter is periodic over its bounds.
Sourcepub fn periodic_bounds(&self) -> Option<(f64, f64)>
pub fn periodic_bounds(&self) -> Option<(f64, f64)>
Return the validated canonical half-open periodic interval.
Sourcepub fn unit_label(&self) -> Option<&str>
pub fn unit_label(&self) -> Option<&str>
Returns the optional human-readable unit label.
Sourcepub fn latex_label(&self) -> Option<&str>
pub fn latex_label(&self) -> Option<&str>
Returns the optional LaTeX-formatted label.
Sourcepub fn description_text(&self) -> Option<&str>
pub fn description_text(&self) -> Option<&str>
Returns the optional longer description.
Trait Implementations§
Source§impl AddAssign<&Parameter> for Expr
impl AddAssign<&Parameter> for Expr
Source§fn add_assign(&mut self, rhs: &Parameter)
fn add_assign(&mut self, rhs: &Parameter)
+= operation. Read moreSource§impl AddAssign<Parameter> for Expr
impl AddAssign<Parameter> for Expr
Source§fn add_assign(&mut self, rhs: Parameter)
fn add_assign(&mut self, rhs: Parameter)
+= operation. Read moreSource§impl<'de> Deserialize<'de> for Parameter
impl<'de> Deserialize<'de> for Parameter
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>,
Source§impl DivAssign<&Parameter> for Expr
impl DivAssign<&Parameter> for Expr
Source§fn div_assign(&mut self, rhs: &Parameter)
fn div_assign(&mut self, rhs: &Parameter)
/= operation. Read moreSource§impl DivAssign<Parameter> for Expr
impl DivAssign<Parameter> for Expr
Source§fn div_assign(&mut self, rhs: Parameter)
fn div_assign(&mut self, rhs: Parameter)
/= operation. Read moreSource§impl MulAssign<&Parameter> for Expr
impl MulAssign<&Parameter> for Expr
Source§fn mul_assign(&mut self, rhs: &Parameter)
fn mul_assign(&mut self, rhs: &Parameter)
*= operation. Read moreSource§impl MulAssign<Parameter> for Expr
impl MulAssign<Parameter> for Expr
Source§fn mul_assign(&mut self, rhs: Parameter)
fn mul_assign(&mut self, rhs: Parameter)
*= operation. Read more