pub trait Scalar:
Signed
+ Pow<Self, Output = Self, Output = Self>
+ Pow<i32>
+ FromPrimitive
+ ToPrimitive
+ Display
+ Debug
+ Copy
+ PartialEq
+ PartialOrd
+ AddAssign
+ SubAssign
+ MulAssign
+ DivAssign
+ Send
+ Sync
+ 'static {
const EPSILON: Self;
const INFINITY: Self;
const NAN: Self;
// Required methods
fn is_nan(self) -> bool;
fn sqrt(self) -> Self;
fn exp(self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn max(self, other: Self) -> Self;
}Expand description
A scalar type suitable for numerical computations in ODE solvers.
This trait aggregates the crate-local numeric requirements shared across diffsol.
§Implementations
DiffSol provides implementations for f64 and f32.
§Examples
use diffsol_la::Scalar;
fn compute<T: Scalar>(x: T, y: T) -> T {
x * x + y
}Required Associated Constants§
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".