pub struct OneSeedLane<L: Lane, const K: usize> {
pub base: Order2Lane<L, K>,
pub eps: Order2Lane<L, K>,
}Expand description
Lane-batched OneSeed: the same one-seed directional scalar with its two
Order2 parts re-typed to Order2Lane<L, K>, so one L = f64x4
instance carries FOUR rows’ contracted-third evaluations per vector pass.
Every operation (add/sub/mul/neg/scale/compose_unary and the
transcendentals) is a term-for-term structural re-type of the scalar
OneSeed ops onto the lane-implemented Order2Lane algebra. With
L = f64, OneSeedLane<f64, K> is to_bits-identical to OneSeed<K>;
with L = f64x4, lane i is to_bits-identical to that (see batch_tests).
Fields§
§base: Order2Lane<L, K>The ε⁰ part (lane-batched value / gradient / Hessian of ℓ).
eps: Order2Lane<L, K>The ε¹ part. After a seed_direction(u) evaluation,
eps.h[a][b] lane i is row i’s Σ_c ℓ_{abc} u_c.
Implementations§
Source§impl<L: Lane, const K: usize> OneSeedLane<L, K>
impl<L: Lane, const K: usize> OneSeedLane<L, K>
Sourcepub fn constant(c: L) -> Self
pub fn constant(c: L) -> Self
A constant: base = constant(c), ε-part zero (mirrors OneSeed::constant).
Sourcepub fn variable(value: L, axis: usize) -> Self
pub fn variable(value: L, axis: usize) -> Self
The seeded variable p_axis at (per-lane) value value, no ε-direction
(mirrors OneSeed::variable).
Sourcepub fn seed_direction(value: L, axis: usize, u_axis: L) -> Self
pub fn seed_direction(value: L, axis: usize, u_axis: L) -> Self
Seed primary axis at (per-lane) value value with ε-direction
component u_axis: base = variable(value, axis), eps = constant(u_axis)
(mirrors OneSeed::seed_direction). With L = f64x4, value / u_axis
pack the four rows’ values / directions of primary axis.
Sourcepub fn contracted_third(&self) -> [[L; K]; K]
pub fn contracted_third(&self) -> [[L; K]; K]
The contracted-third channel after a seed_direction(u) evaluation:
out[a][b] lane i is row i’s Σ_c ℓ_{abc} u_c (the ε-part Hessian).
Sourcepub fn add(&self, o: &Self) -> Self
pub fn add(&self, o: &Self) -> Self
Lane-wise self + o (mirrors OneSeed::add).
Sourcepub fn sub(&self, o: &Self) -> Self
pub fn sub(&self, o: &Self) -> Self
Lane-wise self - o (mirrors OneSeed::sub).
Sourcepub fn mul(&self, o: &Self) -> Self
pub fn mul(&self, o: &Self) -> Self
Lane-wise self · o, ε² = 0 truncation (mirrors OneSeed::mul).
Sourcepub fn neg(&self) -> Self
pub fn neg(&self) -> Self
Negate every part (mirrors OneSeed::neg).
Sourcepub fn scale(&self, s: f64) -> Self
pub fn scale(&self, s: f64) -> Self
Multiply every part by the plain scalar s (mirrors OneSeed::scale).
Sourcepub fn compose_unary(&self, d: [L; 5]) -> Self
pub fn compose_unary(&self, d: [L; 5]) -> Self
Exact order-≤2-per-part Faà di Bruno composition f ∘ self, given the
per-lane outer-derivative stack d = [f, f′, f″, f‴, f⁗]. Term-for-term
identical to OneSeed::compose_unary: the base reads d[0..=2] and the
ε-coefficient is f′(base) (reads d[1..=3]) times eps.
Sourcepub fn exp(&self) -> Self
pub fn exp(&self) -> Self
e^self, per-lane stack [e, e, e, e, e] (matches JetScalar::exp).
Sourcepub fn ln(&self) -> Self
pub fn ln(&self) -> Self
ln(self); caller guarantees positivity (matches JetScalar::ln).
Sourcepub fn sqrt(&self) -> Self
pub fn sqrt(&self) -> Self
√self; caller guarantees positivity (matches JetScalar::sqrt).
Sourcepub fn recip(&self) -> Self
pub fn recip(&self) -> Self
1/self (matches JetScalar::recip).
Sourcepub fn powf(&self, a: f64) -> Self
pub fn powf(&self, a: f64) -> Self
self^a for real a; caller guarantees a positive base (matches
JetScalar::powf).
Sourcepub fn ln_gamma(&self) -> Self
pub fn ln_gamma(&self) -> Self
ln Γ(self); caller guarantees positivity (matches JetScalar::ln_gamma,
same hand-certified stack).
Sourcepub fn digamma(&self) -> Self
pub fn digamma(&self) -> Self
ψ(self) digamma; caller guarantees positivity (matches
JetScalar::digamma, same hand-certified stack).
Source§impl<const K: usize> OneSeedLane<f64x4, K>
impl<const K: usize> OneSeedLane<f64x4, K>
Sourcepub fn lane(&self, i: usize) -> OneSeed<K>
pub fn lane(&self, i: usize) -> OneSeed<K>
Extract lane i’s parts as a production OneSeed<K>. Lane i is
to_bits-identical to evaluating the same program at OneSeed<K> on
row i (see batch_tests).
Trait Implementations§
Source§impl<L: Clone + Lane, const K: usize> Clone for OneSeedLane<L, K>
impl<L: Clone + Lane, const K: usize> Clone for OneSeedLane<L, K>
Source§fn clone(&self) -> OneSeedLane<L, K>
fn clone(&self) -> OneSeedLane<L, K>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<L: Copy + Lane, const K: usize> Copy for OneSeedLane<L, K>
Auto Trait Implementations§
impl<L, const K: usize> Freeze for OneSeedLane<L, K>where
L: Freeze,
impl<L, const K: usize> RefUnwindSafe for OneSeedLane<L, K>where
L: RefUnwindSafe,
impl<L, const K: usize> Send for OneSeedLane<L, K>where
L: Send,
impl<L, const K: usize> Sync for OneSeedLane<L, K>where
L: Sync,
impl<L, const K: usize> Unpin for OneSeedLane<L, K>where
L: Unpin,
impl<L, const K: usize> UnsafeUnpin for OneSeedLane<L, K>where
L: UnsafeUnpin,
impl<L, const K: usize> UnwindSafe for OneSeedLane<L, K>where
L: UnwindSafe,
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.