Skip to main content

OdeCallbacksInit

Struct OdeCallbacksInit 

Source
pub struct OdeCallbacksInit<'a, M: Matrix>(/* private fields */);
Expand description

The initial condition of an OdeCallbacks.

Trait Implementations§

Source§

impl<M: Matrix> ConstantOp for OdeCallbacksInit<'_, M>

Source§

fn call_inplace(&self, t: M::T, y: &mut M::V)

Source§

fn call(&self, t: Self::T) -> Self::V

Source§

impl<M: Matrix> ConstantOpSens for OdeCallbacksInit<'_, M>

Source§

fn sens_mul_inplace(&self, t: M::T, v: &M::V, y: &mut M::V)

Compute the product of the gradient of F wrt a parameter vector p with a given vector J_p(x, t) * v. Note that the vector v is of size nparams() and the result is of size nstates().
Source§

fn sens_inplace(&self, t: M::T, y: &mut M)

Compute the gradient of the operator wrt a parameter vector p and store it in the matrix y. y should have been previously initialised using the output of Self::sens_sparsity. The default implementation of this method computes the gradient using Self::sens_mul_inplace, but it can be overriden for more efficient implementations.
Source§

fn sens_sparsity(&self) -> Option<M::Sparsity>

Source§

fn _default_sens_inplace(&self, t: Self::T, y: &mut Self::M)

Default implementation of the gradient computation (this is the default for Self::sens_inplace).
Source§

fn sens(&self, t: Self::T) -> Self::M

Compute the gradient of the operator wrt a parameter vector p and return it. See Self::sens_inplace for a non-allocating version.
Source§

impl<M: Matrix> ConstantOpSensAdjoint for OdeCallbacksInit<'_, M>

Source§

fn sens_transpose_mul_inplace(&self, t: M::T, v: &M::V, y: &mut M::V)

Compute the product of the transpose of the gradient of F wrt a parameter vector p with a given vector -J_p^T(x, t) * v. Note that the vector v is of size nstates() and the result is of size nparam().
Source§

fn sens_adjoint(&self, t: Self::T) -> Self::M

Compute the negative transpose of the gradient of the operator wrt a parameter vector p and return it. See Self::sens_adjoint_inplace for a non-allocating version.
Source§

fn sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)

Compute the negative transpose of the gradient of the operator wrt a parameter vector p and store it in the matrix y. y should have been previously initialised using the output of Self::sens_adjoint_sparsity. The default implementation of this method computes the gradient using Self::sens_transpose_mul_inplace, but it can be overriden for more efficient implementations.
Source§

fn _default_sens_adjoint_inplace(&self, t: Self::T, y: &mut Self::M)

Default implementation of the gradient computation (this is the default for Self::sens_adjoint_inplace).
Source§

fn sens_adjoint_sparsity(&self) -> Option<<Self::M as Matrix>::Sparsity>

Source§

impl<M: Matrix> Op for OdeCallbacksInit<'_, M>

Source§

type T = <M as MatrixCommon>::T

Source§

type V = <M as MatrixCommon>::V

Source§

type M = M

Source§

type C = <M as MatrixCommon>::C

Source§

fn context(&self) -> &Self::C

return the context of the operator
Source§

fn nstates(&self) -> usize

Return the number of input states of the operator.
Source§

fn nout(&self) -> usize

Return the number of outputs of the operator.
Source§

fn nparams(&self) -> usize

Return the number of parameters of the operator.
Source§

fn statistics(&self) -> OpStatistics

Return statistics about the operator (e.g. how many times it was called, how many times the jacobian was computed, etc.)

Auto Trait Implementations§

§

impl<'a, M> !RefUnwindSafe for OdeCallbacksInit<'a, M>

§

impl<'a, M> !Send for OdeCallbacksInit<'a, M>

§

impl<'a, M> !Sync for OdeCallbacksInit<'a, M>

§

impl<'a, M> !UnwindSafe for OdeCallbacksInit<'a, M>

§

impl<'a, M> Forget for OdeCallbacksInit<'a, M>

§

impl<'a, M> Freeze for OdeCallbacksInit<'a, M>
where &'a OdeCallbacks<M>: Freeze,

§

impl<'a, M> Unpin for OdeCallbacksInit<'a, M>
where &'a OdeCallbacks<M>: Unpin,

§

impl<'a, M> UnsafeUnpin for OdeCallbacksInit<'a, M>
where &'a OdeCallbacks<M>: UnsafeUnpin,

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

Source§

fn by_ref(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.