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 moreAuto Trait Implementations§
impl Freeze for ParameterSet
impl RefUnwindSafe for ParameterSet
impl Send for ParameterSet
impl Sync for ParameterSet
impl Unpin for ParameterSet
impl UnsafeUnpin for ParameterSet
impl UnwindSafe for ParameterSet
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more