pub trait OdeState: Clone {
// Required methods
fn add(&self, other: &Self) -> Self;
fn add_assign(&mut self, other: &Self);
fn sub(&self, other: &Self) -> Self;
fn sub_assign(&mut self, other: &Self);
fn mul(&self, scalar: f64) -> Self;
fn mul_assign(&mut self, scalar: f64);
fn get_state_variable(&self, index: StateIndex) -> f64;
}Expand description
Trait defining an ODE solver state (i.e. the dependent variable in an ODE).
Any type implementing this trait can be used as the dependent variable in an ODE.
This crate implements this trait for the following types:
f64Vec<f64>linalg_traits::Mat<f64>nalgebra::DVector<f64>nalgebra::SVector<f64, N>nalgebra::DMatrix<f64>nalgebra::SMatrix<f64, R, C>ndarray::Array1<f64>ndarray::Array2<f64>
§Note on the lack of blanket implementations
We cannot perform blanket implementations using
linalg_traits::Scalar,
linalg_traits::Vector,
and
linalg_traits::Matrix.
There is nothing restricting types from implementing a combination of these three traits, so the
compiler will not allow blanket implementations binding to these traits to avoid any potential
conflicting implementations.
Required Methods§
Sourcefn add_assign(&mut self, other: &Self)
fn add_assign(&mut self, other: &Self)
Sourcefn sub_assign(&mut self, other: &Self)
fn sub_assign(&mut self, other: &Self)
Sourcefn mul_assign(&mut self, scalar: f64)
fn mul_assign(&mut self, scalar: f64)
Sourcefn get_state_variable(&self, index: StateIndex) -> f64
fn get_state_variable(&self, index: StateIndex) -> f64
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.