pub struct ClosureSystem<S: Scalar, F> { /* private fields */ }Expand description
Closure-shaped adapter for solve_forward_sensitivity_with.
Wraps a closure of shape Fn(t, y, p, dydt) and a fixed parameter vector
into a ParametricOdeSystem using FD-default Jacobians. Public so that
callers writing a one-shot harness can construct it explicitly when they
need to share it across multiple solver invocations.
Implementations§
Trait Implementations§
Source§impl<S: Scalar, F> ParametricOdeSystem<S> for ClosureSystem<S, F>
impl<S: Scalar, F> ParametricOdeSystem<S> for ClosureSystem<S, F>
Source§fn params(&self) -> &[S]
fn params(&self) -> &[S]
Nominal parameter vector. Length must equal
Self::n_params.Source§fn rhs(&self, t: S, y: &[S], dydt: &mut [S])
fn rhs(&self, t: S, y: &[S], dydt: &mut [S])
Convenience: evaluate the RHS at the system’s nominal parameters.
Source§fn jacobian_y(&self, t: S, y: &[S], jac: &mut [S])
fn jacobian_y(&self, t: S, y: &[S], jac: &mut [S])
Fill the state Jacobian
J_y[i,j] = ∂f_i/∂y_j in row-major order
(jac[i*N + j], length N²). Read moreSource§fn jacobian_p(&self, t: S, y: &[S], jp: &mut [S])
fn jacobian_p(&self, t: S, y: &[S], jp: &mut [S])
Fill the parameter Jacobian
J_p[i,k] = ∂f_i/∂p_k in column-major
order (jp[k*N + i], length N · N_s). Read moreSource§fn initial_sensitivity(&self, _y0: &[S], s0: &mut [S])
fn initial_sensitivity(&self, _y0: &[S], s0: &mut [S])
Source§fn has_analytical_jacobian_y(&self) -> bool
fn has_analytical_jacobian_y(&self) -> bool
Returns
true iff Self::jacobian_y has been overridden with an
analytical implementation. Default: false. Read moreSource§fn has_analytical_jacobian_p(&self) -> bool
fn has_analytical_jacobian_p(&self) -> bool
Returns
true iff Self::jacobian_p has been overridden with an
analytical implementation. Default: false. See
Self::has_analytical_jacobian_y for the rationale, contract,
and debug-build consistency check.Auto Trait Implementations§
impl<S, F> Freeze for ClosureSystem<S, F>where
F: Freeze,
impl<S, F> RefUnwindSafe for ClosureSystem<S, F>where
F: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, F> Send for ClosureSystem<S, F>where
F: Send,
impl<S, F> Sync for ClosureSystem<S, F>where
F: Sync,
impl<S, F> Unpin for ClosureSystem<S, F>
impl<S, F> UnsafeUnpin for ClosureSystem<S, F>where
F: UnsafeUnpin,
impl<S, F> UnwindSafe for ClosureSystem<S, F>where
F: UnwindSafe,
S: UnwindSafe,
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
Mutably borrows from an owned value. Read more
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>
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 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>
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