pub struct TwoSeedLane<L: Lane, const K: usize> {
pub base: Order2Lane<L, K>,
pub eps: Order2Lane<L, K>,
pub del: Order2Lane<L, K>,
pub eps_del: Order2Lane<L, K>,
}Expand description
Lane-batched TwoSeed: the same two-seed scalar with its four Order2
parts re-typed to Order2Lane<L, K>, so one L = f64x4 instance carries
FOUR rows’ contracted-fourth evaluations per vector pass.
Every operation is a term-for-term structural re-type of the scalar
TwoSeed ops onto the lane-implemented Order2Lane algebra. With
L = f64, TwoSeedLane<f64, K> is to_bits-identical to TwoSeed<K>;
with L = f64x4, lane i is to_bits-identical to that (see batch_tests).
Fields§
§base: Order2Lane<L, K>The ε⁰δ⁰ part.
eps: Order2Lane<L, K>The ε¹δ⁰ part.
del: Order2Lane<L, K>The ε⁰δ¹ part.
eps_del: Order2Lane<L, K>The ε¹δ¹ part. After a seed(u, v) evaluation, eps_del.h[a][b]
lane i is row i’s Σ_{cd} ℓ_{abcd} u_c v_d.
Implementations§
Source§impl<L: Lane, const K: usize> TwoSeedLane<L, K>
impl<L: Lane, const K: usize> TwoSeedLane<L, K>
Sourcepub fn constant(c: L) -> Self
pub fn constant(c: L) -> Self
A constant: base = constant(c), all seed parts zero (mirrors
TwoSeed::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 TwoSeed::variable).
Sourcepub fn seed(value: L, axis: usize, u_axis: L, v_axis: L) -> Self
pub fn seed(value: L, axis: usize, u_axis: L, v_axis: L) -> Self
Seed primary axis at (per-lane) value value with ε-direction u_axis
and δ-direction v_axis (mirrors TwoSeed::seed). With L = f64x4,
each argument packs the four rows’ values for primary axis.
Sourcepub fn contracted_fourth(&self) -> [[L; K]; K]
pub fn contracted_fourth(&self) -> [[L; K]; K]
The contracted-fourth channel after a seed(u, v) evaluation:
out[a][b] lane i is row i’s Σ_{cd} ℓ_{abcd} u_c v_d
(the εδ-part Hessian).
Sourcepub fn add(&self, o: &Self) -> Self
pub fn add(&self, o: &Self) -> Self
Lane-wise self + o (mirrors TwoSeed::add).
Sourcepub fn sub(&self, o: &Self) -> Self
pub fn sub(&self, o: &Self) -> Self
Lane-wise self - o (mirrors TwoSeed::sub).
Sourcepub fn mul(&self, o: &Self) -> Self
pub fn mul(&self, o: &Self) -> Self
Lane-wise self · o, ε² = δ² = 0 truncation (mirrors TwoSeed::mul).
Sourcepub fn neg(&self) -> Self
pub fn neg(&self) -> Self
Negate every part (mirrors TwoSeed::neg).
Sourcepub fn scale(&self, s: f64) -> Self
pub fn scale(&self, s: f64) -> Self
Multiply every part by the plain scalar s (mirrors TwoSeed::scale).
Sourcepub fn compose_unary(&self, d: [L; 5]) -> Self
pub fn compose_unary(&self, d: [L; 5]) -> Self
Exact composition f ∘ self, given the per-lane outer-derivative stack
d = [f, f′, f″, f‴, f⁗]. Term-for-term identical to
TwoSeed::compose_unary: base reads d[0..=2], f′(base) reads
d[1..=3], f″(base) reads d[2..=4], and the cross part carries
f″·eps·del + f′·eps_del.
Sourcepub fn exp(&self) -> Self
pub fn exp(&self) -> Self
e^self, per-lane stack [e; 5] (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).
Sourcepub fn digamma(&self) -> Self
pub fn digamma(&self) -> Self
ψ(self) digamma; caller guarantees positivity (matches
JetScalar::digamma).
Source§impl<const K: usize> TwoSeedLane<f64x4, K>
impl<const K: usize> TwoSeedLane<f64x4, K>
Sourcepub fn lane(&self, i: usize) -> TwoSeed<K>
pub fn lane(&self, i: usize) -> TwoSeed<K>
Extract lane i’s parts as a production TwoSeed<K>. Lane i is
to_bits-identical to evaluating the same program at TwoSeed<K> on
row i (see batch_tests).
Trait Implementations§
Source§impl<L: Clone + Lane, const K: usize> Clone for TwoSeedLane<L, K>
impl<L: Clone + Lane, const K: usize> Clone for TwoSeedLane<L, K>
Source§fn clone(&self) -> TwoSeedLane<L, K>
fn clone(&self) -> TwoSeedLane<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 TwoSeedLane<L, K>
Auto Trait Implementations§
impl<L, const K: usize> Freeze for TwoSeedLane<L, K>where
L: Freeze,
impl<L, const K: usize> RefUnwindSafe for TwoSeedLane<L, K>where
L: RefUnwindSafe,
impl<L, const K: usize> Send for TwoSeedLane<L, K>where
L: Send,
impl<L, const K: usize> Sync for TwoSeedLane<L, K>where
L: Sync,
impl<L, const K: usize> Unpin for TwoSeedLane<L, K>where
L: Unpin,
impl<L, const K: usize> UnsafeUnpin for TwoSeedLane<L, K>where
L: UnsafeUnpin,
impl<L, const K: usize> UnwindSafe for TwoSeedLane<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.