pub struct Callback<'a, const D: usize, P> {
pub event: &'a dyn Fn(f64, SVector<f64, D>, &P) -> f64,
pub effect: &'a dyn Fn(&mut ODE<'_, D, P>),
}Expand description
A function that takes in a time and a state and outputs a single float value
The integration solver will check this function for zero crossings
Fields§
§event: &'a dyn Fn(f64, SVector<f64, D>, &P) -> f64The function to check for zero crossings
effect: &'a dyn Fn(&mut ODE<'_, D, P>)The function to change the ODE
Trait Implementations§
impl<'a, const D: usize, P: Copy> Copy for Callback<'a, D, P>
Auto Trait Implementations§
impl<'a, const D: usize, P> !RefUnwindSafe for Callback<'a, D, P>
impl<'a, const D: usize, P> !Send for Callback<'a, D, P>
impl<'a, const D: usize, P> !Sync for Callback<'a, D, P>
impl<'a, const D: usize, P> !UnwindSafe for Callback<'a, D, P>
impl<'a, const D: usize, P> Freeze for Callback<'a, D, P>
impl<'a, const D: usize, P> Unpin for Callback<'a, D, P>
impl<'a, const D: usize, P> UnsafeUnpin for Callback<'a, D, P>where
&'a dyn Fn(f64, Matrix<f64, Const<D>, Const<1>, ArrayStorage<f64, D, 1>>, &P) -> f64: UnsafeUnpin,
&'a dyn Fn(&mut ODE<'_, D, P>): UnsafeUnpin,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.