differential_equations/control.rs
1//! Control flow flags used by solvers, events, and output callbacks.
2
3use crate::traits::{Real, State};
4
5/// Directive to the solver indicating how to proceed with integration.
6///
7/// Returned by event functions and `Solout` callbacks to steer execution.
8///
9#[derive(Debug, Clone)]
10pub enum ControlFlag<T = f64, Y = f64>
11where
12 T: Real,
13 Y: State<T>,
14{
15 /// Continue to the next step.
16 Continue,
17 /// Replace the current state and continue to the next step.
18 ModifyState(T, Y),
19 /// Terminate the solver with the given reason/data.
20 Terminate,
21}