Skip to main content

TwoSeedLane

Struct TwoSeedLane 

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

Source

pub fn constant(c: L) -> Self

A constant: base = constant(c), all seed parts zero (mirrors TwoSeed::constant).

Source

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

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

Source

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.

Source

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

Source

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

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

Source

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

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

Source

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

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

Source

pub fn neg(&self) -> Self

Negate every part (mirrors TwoSeed::neg).

Source

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

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

Source

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.

Source

pub fn exp(&self) -> Self

e^self, per-lane stack [e; 5] (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).

Source

pub fn digamma(&self) -> Self

ψ(self) digamma; caller guarantees positivity (matches JetScalar::digamma).

Source§

impl<const K: usize> TwoSeedLane<f64x4, K>

Source

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>

Source§

fn clone(&self) -> TwoSeedLane<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 TwoSeedLane<L, K>

Source§

impl<L: Debug + Lane, const K: usize> Debug for TwoSeedLane<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 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> 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