pub trait State: Clone {
// Required methods
fn axpy(&mut self, a: f64, other: &Self);
fn scale(&mut self, a: f64);
fn zeros_like(&self) -> Self;
}Expand description
A state vector that an integrator can do arithmetic on.
Deliberately tiny: an integrator needs to scale a state and add a multiple of
another to it, and nothing else. Anything a domain wants to keep alongside its
numbers — a mesh, a material table, a name — stays out of the state and lives
on the Dynamics instead, where it costs nothing to carry.
Required Methods§
Sourcefn axpy(&mut self, a: f64, other: &Self)
fn axpy(&mut self, a: f64, other: &Self)
self += a * other, the one operation every explicit integrator is made
of. Implementations must visit their elements in a fixed order.
Sourcefn zeros_like(&self) -> Self
fn zeros_like(&self) -> Self
A zero of the same shape as this state.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".