Skip to main content

ParameterSet

Struct ParameterSet 

Source
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

Source

pub fn new(params: Vec<FitParameter>) -> Self

Source

pub fn n_free(&self) -> usize

Number of free (non-fixed) parameters.

Source

pub fn free_values(&self) -> Vec<f64>

Get the values of all free parameters as a vector.

Source

pub fn set_free_values(&mut self, values: &[f64])

Set the values of free parameters from a vector.

§Panics

Panics if values.len() != self.n_free().

Source

pub fn all_values(&self) -> Vec<f64>

Get the value of all parameters (fixed + free) as a vector.

Source

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.

Source

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.

Source

pub fn free_indices(&self) -> Vec<usize>

Indices (into params) of free parameters.

Source

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

Source§

fn clone(&self) -> ParameterSet

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParameterSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> ByRef<T> for T

§

fn by_ref(&self) -> &T

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,