pub struct OneSeed<const K: usize> {
pub base: Order2<K>,
pub eps: Order2<K>,
}Expand description
One-seed directional scalar: an Order2 base plus ONE nilpotent ε
(ε² = 0) whose coefficient is itself an Order2.
A scalar is s = base + ε·eps. Arithmetic is the ε² = 0 truncation of the
product (doc §A.2): the base parts multiply as ordinary Order2 products,
and the ε-coefficient picks up a.base·b.eps + a.eps·b.base. Composition
pushes ε through one extra outer derivative.
Seed each primary with seed_direction: the base is
the usual seeded variable (carrying e_a for the Hessian channel) and the
ε-coefficient is the FIXED contraction direction u_a (a constant). Then the
ε-component of the evaluated Hessian channel is the contracted third
[eps.h][a][b] = Σ_c ℓ_{abc} u_c — exactly row_third_contracted(dir = u),
without materialising t3.
Fields§
§base: Order2<K>The ε⁰ part: value / gradient / Hessian of ℓ.
eps: Order2<K>The ε¹ part: value / gradient / Hessian of the ε-coefficient. After a
seed_direction(u) evaluation, eps.h[a][b] = Σ_c ℓ_{abc} u_c.
Implementations§
Source§impl<const K: usize> OneSeed<K>
impl<const K: usize> OneSeed<K>
Sourcepub fn seed_direction(x: f64, axis: usize, u_axis: f64) -> Self
pub fn seed_direction(x: f64, axis: usize, u_axis: f64) -> Self
Seed primary axis at value x with ε-direction component u_axis:
p_axis = p_axis⁰ + x-seed + ε·u_axis, i.e. base = variable(x, axis)
and eps = constant(u_axis) (doc §A.2 “Seeding”).
Sourcepub fn contracted_third(&self) -> [[f64; K]; K]
pub fn contracted_third(&self) -> [[f64; K]; K]
The contracted-third channel after a seed_direction(u) evaluation:
out[a][b] = Σ_c ℓ_{abc} u_c, i.e. the ε-coefficient’s Hessian (doc §A.2).
Trait Implementations§
impl<const K: usize> Copy for OneSeed<K>
Source§impl<const K: usize> JetScalar<K> for OneSeed<K>
impl<const K: usize> JetScalar<K> for OneSeed<K>
Source§fn variable(x: f64, axis: usize) -> Self
fn variable(x: f64, axis: usize) -> Self
p_axis at value x: unit first derivative in slot
axis, all higher channels zero. (The nilpotent / cross channels of the
directional scalars are seeded zero — callers set ε/δ directions through
the scalar-specific OneSeed::seed_direction / TwoSeed::seed.)Source§fn compose_unary(&self, d: [f64; 5]) -> Self
fn compose_unary(&self, d: [f64; 5]) -> Self
f ∘ self, given the outer
derivative stack d = [f(u), f′(u), f″(u), f‴(u), f⁗(u)] at
u = self.value(). Read moreSource§fn ln(&self) -> Self
fn ln(&self) -> Self
ln(self). Caller guarantees positivity. Same derivative stack
crate::jet_tower::Tower4::ln uses, so any program written over both
matches term-for-term.Source§fn powf(&self, a: f64) -> Self
fn powf(&self, a: f64) -> Self
self^a for real exponent a. Caller guarantees a positive base.
Mirrors crate::jet_tower::Tower4::powf (falling-factorial stack).Source§fn ln_gamma(&self) -> Self
fn ln_gamma(&self) -> Self
ln Γ(self). Caller guarantees a positive argument. Uses the SAME
hand-certified derivative stack crate::jet_tower::Tower4::ln_gamma
consumes (crate::jet_tower::ln_gamma_derivative_stack), so any
program written over both matches term-for-term.Source§fn digamma(&self) -> Self
fn digamma(&self) -> Self
ψ(self) = d/dx ln Γ(x) (digamma). Caller guarantees a positive
argument. Same hand-certified stack
crate::jet_tower::digamma_derivative_stack.Auto Trait Implementations§
impl<const K: usize> Freeze for OneSeed<K>
impl<const K: usize> RefUnwindSafe for OneSeed<K>
impl<const K: usize> Send for OneSeed<K>
impl<const K: usize> Sync for OneSeed<K>
impl<const K: usize> Unpin for OneSeed<K>
impl<const K: usize> UnsafeUnpin for OneSeed<K>
impl<const K: usize> UnwindSafe for OneSeed<K>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.