Skip to main content

OneSeedLane

Struct OneSeedLane 

Source
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>

Source

pub fn constant(c: L) -> Self

A constant: base = constant(c), ε-part zero (mirrors OneSeed::constant).

Source

pub fn variable(value: L, axis: usize) -> Self

The seeded variable p_axis at (per-lane) value value, no ε-direction (mirrors OneSeed::variable).

Source

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.

Source

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).

Source

pub fn add(&self, o: &Self) -> Self

Lane-wise self + o (mirrors OneSeed::add).

Source

pub fn sub(&self, o: &Self) -> Self

Lane-wise self - o (mirrors OneSeed::sub).

Source

pub fn mul(&self, o: &Self) -> Self

Lane-wise self · o, ε² = 0 truncation (mirrors OneSeed::mul).

Source

pub fn neg(&self) -> Self

Negate every part (mirrors OneSeed::neg).

Source

pub fn scale(&self, s: f64) -> Self

Multiply every part by the plain scalar s (mirrors OneSeed::scale).

Source

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.

Source

pub fn exp(&self) -> Self

e^self, per-lane stack [e, e, e, e, e] (matches JetScalar::exp).

Source

pub fn ln(&self) -> Self

ln(self); caller guarantees positivity (matches JetScalar::ln).

Source

pub fn sqrt(&self) -> Self

√self; caller guarantees positivity (matches JetScalar::sqrt).

Source

pub fn recip(&self) -> Self

1/self (matches JetScalar::recip).

Source

pub fn powf(&self, a: f64) -> Self

self^a for real a; caller guarantees a positive base (matches JetScalar::powf).

Source

pub fn ln_gamma(&self) -> Self

ln Γ(self); caller guarantees positivity (matches JetScalar::ln_gamma, same hand-certified stack).

Source

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>

Source

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>

Source§

fn clone(&self) -> OneSeedLane<L, K>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<L: Copy + Lane, const K: usize> Copy for OneSeedLane<L, K>

Source§

impl<L: Debug + Lane, const K: usize> Debug for OneSeedLane<L, K>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V