pub struct ParameterSet {
pub params: Vec<FitParameter>,
}Expand description
Collection of fit parameters for a forward model fit.
Fields§
§params: Vec<FitParameter>All parameters (fixed + free).
Implementations§
Source§impl ParameterSet
impl ParameterSet
pub fn new(params: Vec<FitParameter>) -> Self
Sourcepub fn free_values(&self) -> Vec<f64>
pub fn free_values(&self) -> Vec<f64>
Get the values of all free parameters as a vector.
Sourcepub fn set_free_values(&mut self, values: &[f64])
pub fn set_free_values(&mut self, values: &[f64])
Sourcepub fn all_values(&self) -> Vec<f64>
pub fn all_values(&self) -> Vec<f64>
Get the value of all parameters (fixed + free) as a vector.
Sourcepub fn all_values_into(&self, buf: &mut Vec<f64>)
pub fn all_values_into(&self, buf: &mut Vec<f64>)
Write all parameter values into the provided buffer, resizing if needed.
This is the buffer-reuse counterpart of all_values.
Callers that fit many pixels in a loop can allocate one Vec<f64> and
reuse it across iterations to avoid per-pixel allocation churn.
Sourcepub fn free_values_into(&self, buf: &mut Vec<f64>)
pub fn free_values_into(&self, buf: &mut Vec<f64>)
Write free parameter values into the provided buffer, resizing if needed.
This is the buffer-reuse counterpart of free_values.
Callers that fit many pixels in a loop can allocate one Vec<f64> and
reuse it across iterations to avoid per-pixel allocation churn.
Sourcepub fn free_indices(&self) -> Vec<usize>
pub fn free_indices(&self) -> Vec<usize>
Indices (into params) of free parameters.
Sourcepub fn free_indices_into(&self, buf: &mut Vec<usize>)
pub fn free_indices_into(&self, buf: &mut Vec<usize>)
Write free parameter indices into the provided buffer, resizing if needed.
This is the buffer-reuse counterpart of free_indices.
Callers that compute the Jacobian many times in a loop can allocate one
Vec<usize> and reuse it across iterations to avoid per-call allocation.
Trait Implementations§
Source§impl Clone for ParameterSet
impl Clone for ParameterSet
Source§fn clone(&self) -> ParameterSet
fn clone(&self) -> ParameterSet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more