Skip to main content

SensitivityResult

Struct SensitivityResult 

Source
pub struct SensitivityResult<S>
where S: Scalar,
{ pub t: Vec<S>, pub y: Vec<S>, pub sensitivity: Vec<S>, pub n_states: usize, pub n_params: usize, pub stats: SolverStats, pub success: bool, pub message: String, }
Expand description

Result of an ODE forward-sensitivity solve.

Layout matches the conventions in the module-level docs: the state y is row-major over time; the sensitivity is row-major over time, column-major within each per-time block.

Fields§

§t: Vec<S>

Output time points (length n_times).

§y: Vec<S>

State trajectory: y[i*N + j] = y_j(t_i), length n_times * N.

§sensitivity: Vec<S>

Sensitivities: per-time block of length N · N_s, column-major within the block, so sensitivity[i * (N*N_s) + k*N + j] = ∂y_j(t_i)/∂p_k.

§n_states: usize

Number of state variables N.

§n_params: usize

Number of parameters N_s.

§stats: SolverStats

Solver statistics from the underlying integration.

§success: bool

Was the integration successful?

§message: String

Error description if the integration failed.

Implementations§

Source§

impl<S> SensitivityResult<S>
where S: Scalar,

Source

pub fn len(&self) -> usize

Number of output time points.

Source

pub fn is_empty(&self) -> bool

true if there are no output time points.

Source

pub fn y_at(&self, i: usize) -> &[S]

State vector at output index i (length N).

Source

pub fn sensitivity_at(&self, i: usize) -> &[S]

Full sensitivity block at output index i, column-major (length N · N_s). sensitivity_at(i)[k*N + j] = ∂y_j(t_i)/∂p_k.

Source

pub fn sensitivity_for_param(&self, i: usize, k: usize) -> &[S]

Contiguous slice S_{:,k}(t_i) = ∂y/∂p_k at output index i, length N. Free slice thanks to the column-major flattening.

Source

pub fn dyi_dpj(&self, i: usize, state: usize, param: usize) -> S

Single component ∂y_state(t_i)/∂p_param.

Source

pub fn final_state(&self) -> &[S]

State at the final output time. Returns an empty slice if the result has no time points.

Source

pub fn final_sensitivity(&self) -> &[S]

Sensitivity block at the final output time, column-major (length N · N_s). Empty slice when the result has no time points.

Source

pub fn normalized_sensitivity_at(&self, i: usize, p_nominal: &[S]) -> Vec<S>

Normalised (logarithmic) sensitivity at output index i: (p_k / y_j) · ∂y_j/∂p_k, column-major in the same shape as Self::sensitivity_at. Components where |y_j| falls below 1e-15 · max(1, |y|_∞) are reported as zero to avoid blow-up.

Trait Implementations§

Source§

impl<S> Clone for SensitivityResult<S>
where S: Clone + Scalar,

Source§

fn clone(&self) -> SensitivityResult<S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S> Debug for SensitivityResult<S>
where S: Debug + Scalar,

Source§

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

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
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V