pub struct Rk4Solver<S: OdeSystem> { /* private fields */ }Expand description
Runge-Kutta 4th order ODE solver with GPU acceleration
Implementations§
Source§impl<S: OdeSystem> Rk4Solver<S>
impl<S: OdeSystem> Rk4Solver<S>
Sourcepub fn step(&mut self, t: f64, y: f64, h: f64) -> f64
pub fn step(&mut self, t: f64, y: f64, h: f64) -> f64
Performs a single RK4 step
RK4 coefficients: k1 = f(t, y) k2 = f(t + h/2, y + hk1/2) k3 = f(t + h/2, y + hk2/2) k4 = f(t + h, y + h*k3) y_{n+1} = y_n + (h/6)(k1 + 2k2 + 2k3 + k4)
Sourcepub fn step_gpu(
&mut self,
_integrator: &mut PlatformGpuIntegrator,
t: f64,
y: f64,
h: f64,
) -> Result<f64, GpuError>
pub fn step_gpu( &mut self, _integrator: &mut PlatformGpuIntegrator, t: f64, y: f64, h: f64, ) -> Result<f64, GpuError>
Performs RK4 step using GPU acceleration
Offloads the k1-k4 computations to the GPU via PlatformGpuIntegrator
Sourcepub fn step_quin(&mut self, quin: NQuin, h: f64) -> NQuin
pub fn step_quin(&mut self, quin: NQuin, h: f64) -> NQuin
Performs RK4 step directly on a Quin
This is the dispatcher-integrated version that takes a Quin, extracts the ODE state, performs the RK4 step, and returns a new Quin with the updated state.
§Arguments
quin- Input Quin with ODE state packed in object/metadata fieldsh- Step size
§Returns
New Quin with updated ODE state
Sourcepub fn step_quin_gpu(
&mut self,
integrator: &mut PlatformGpuIntegrator,
quin: NQuin,
h: f64,
) -> Result<NQuin, GpuError>
pub fn step_quin_gpu( &mut self, integrator: &mut PlatformGpuIntegrator, quin: NQuin, h: f64, ) -> Result<NQuin, GpuError>
Performs RK4 step on Quin using GPU acceleration
Dispatcher-integrated version with GPU support
Sourcepub fn reset_compensation(&mut self)
pub fn reset_compensation(&mut self)
Resets Kahan compensation accumulator
Sourcepub fn compensation(&self) -> f64
pub fn compensation(&self) -> f64
Gets current Kahan compensation value
Auto Trait Implementations§
impl<S> Freeze for Rk4Solver<S>where
S: Freeze,
impl<S> RefUnwindSafe for Rk4Solver<S>where
S: RefUnwindSafe,
impl<S> Send for Rk4Solver<S>
impl<S> Sync for Rk4Solver<S>
impl<S> Unpin for Rk4Solver<S>where
S: Unpin,
impl<S> UnsafeUnpin for Rk4Solver<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for Rk4Solver<S>where
S: UnwindSafe,
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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