pub trait Scalar:
Real
+ Div<Output = Self>
+ FromPrimitive { }Expand description
Scalar sits in the real tower between Real and
RealField: it adds division to Real but, unlike a field, does not
require a total inverse. That is deliberate, so that Dual qualifies — its ε
component is a zero divisor, so it has division yet is not a field. The
deep_causality_calculus crate writes its differentiation and integration operators against
Scalar, so a single model evaluates at f64 (the value) and at Dual (the derivative).
Realsupplies ring arithmetic and the elementary functions (the analytic axis), without requiring field division.DivletsDualitself be aReal, so the tangent functor nests (Dual<Dual<…>>gives higher derivatives).FromPrimitiveis the precision-safe constant lift: a model raises its literal constants into the working scalar at any precision (f32/f64/Float106, andDualover each via the blanket impl in this crate).From<f64>is deliberately not used, becausef32does not implement it.
This is distinct from multivector’s ScalarEval (which abstracts a value’s real modulus over
Real/Complex for norm work); Scalar is the differentiation variable.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".