pub trait JetField {
// Required methods
fn value(&self) -> f64;
fn add(&self, o: &Self) -> Self;
fn sub(&self, o: &Self) -> Self;
fn mul(&self, o: &Self) -> Self;
fn neg(&self) -> Self;
fn scale(&self, s: f64) -> Self;
fn compose_unary(&self, d: [f64; 5]) -> Self;
}Expand description
Minimal scalar field a Dual2 can be built over. Implemented by f64 (the
base case) and by Dual2 itself (the nesting case). Every operation mirrors
the crate::jet_tower::Tower4 / crate::jet_scalar::JetScalar Faà di
Bruno convention exactly, so a program written against JetField evaluates
identically on the engine tower and on a nested dual.
This is the SHARED scalar-field algebra base of the #932 tower: the
const-K packed crate::jet_scalar::JetScalar and the runtime-p
Vec-backed flex jets (survival::marginal_slope::timepoint_exact::FlexJet)
both EXTEND it, so the field ops and the single Faà di Bruno composition are
declared exactly ONCE here. It is deliberately NOT Copy (the Vec-backed
flex jets are Clone, not Copy) and carries no constructor (a Vec-backed
constant needs a primary count) — the Copy, from_f64-carrying nested-dual
oracle path adds those through JetFieldConst.
Required Methods§
fn add(&self, o: &Self) -> Self
fn sub(&self, o: &Self) -> Self
fn mul(&self, o: &Self) -> Self
fn neg(&self) -> Self
Sourcefn compose_unary(&self, d: [f64; 5]) -> Self
fn compose_unary(&self, d: [f64; 5]) -> Self
Faà di Bruno composition f ∘ self given the OUTER real function’s
derivative stack d = [f(u), f′(u), f″(u), f‴(u), f⁗(u)] evaluated at
u = self.value() — the identical [f64; 5] stack shape
crate::jet_tower::Tower4::compose_unary consumes.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".