pub trait ParameterizedAlgorithm<T: Transcendental>: Algorithm<T> {
type Params: Clone + Send + Sync;
// Required methods
fn params(&self) -> &Self::Params;
fn set_params(&mut self, params: Self::Params);
// Provided method
fn set_parameter(
&mut self,
name: &str,
value: ParamValue,
) -> Result<(), &'static str> { ... }
}Expand description
An Algorithm with typed, settable parameters.
Extends the base Algorithm trait with the ability to get and set
a typed parameter struct (Params) and to update individual parameters
by name (for automation integration).
Required Associated Types§
Required Methods§
Sourcefn set_params(&mut self, params: Self::Params)
fn set_params(&mut self, params: Self::Params)
Replace all parameters atomically.
The implementation should recompute any derived coefficients.
Provided Methods§
Sourcefn set_parameter(
&mut self,
name: &str,
value: ParamValue,
) -> Result<(), &'static str>
fn set_parameter( &mut self, name: &str, value: ParamValue, ) -> Result<(), &'static str>
Set a single parameter by name (for automation / scripting).
Default: returns an error for any unrecognised name.