pub struct Order2Lane<L: Lane, const K: usize> {
pub v: L,
pub g: [L; K],
pub h: [[L; K]; K],
}Expand description
A lane-batched order-≤2 Taylor scalar: value / gradient / Hessian carried in
a SIMD field L: Lane. With L = f64x4 one instance carries FOUR
rows at once, so the row loop processes 4 rows per vector pass instead of one
per scalar pass.
The channel layout and every float op mirror crate::jet_tower::Tower2
term-for-term, so Order2Lane<f64, K> is to_bits-identical to the
production Order2<K> and Order2Lane<f64x4, K> lane i is
to_bits-identical to that (see the module note and batch_tests).
Fields§
§v: LValue channel ℓ (one entry per lane/row).
g: [L; K]Gradient channel ∂ℓ/∂p_a.
h: [[L; K]; K]Hessian channel ∂²ℓ/∂p_a∂p_b (symmetric).
Implementations§
Source§impl<L: Lane, const K: usize> Order2Lane<L, K>
impl<L: Lane, const K: usize> Order2Lane<L, K>
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: unit first
derivative in slot axis. With L = f64x4, value packs the four
rows’ values of primary axis.
Sourcepub fn scale(&self, s: f64) -> Self
pub fn scale(&self, s: f64) -> Self
Multiply every channel by the plain scalar s (mirrors Tower2::scale).
Sourcepub fn sub(&self, o: &Self) -> Self
pub fn sub(&self, o: &Self) -> Self
Lane-wise self - o, expressed as self + o·(-1) exactly as
Order2::sub / Tower4::sub do, so signed-zero handling matches.
Sourcepub fn neg(&self) -> Self
pub fn neg(&self) -> Self
Negate every channel (= scale(-1.0), matching Order2::neg).
Sourcepub fn mul(&self, o: &Self) -> Self
pub fn mul(&self, o: &Self) -> Self
Exact order-≤2 Leibniz product, term-for-term identical to
crate::jet_tower::Tower2::mul (same factor order, no mul_add).
Sourcepub fn compose_unary(&self, d: [L; 3]) -> Self
pub fn compose_unary(&self, d: [L; 3]) -> Self
Exact order-≤2 Faà di Bruno composition f ∘ self, given the per-lane
derivative stack d = [f(u), f′(u), f″(u)]. Mirrors
crate::jet_tower::Tower2::compose_unary term-for-term (acc starts at
0 then accumulates, so signed-zero collapses identically).
Sourcepub fn exp(&self) -> Self
pub fn exp(&self) -> Self
e^self, per-lane stack [e, e, e] (matches the JetScalar::exp
default forwarded through Order2).
Sourcepub fn ln(&self) -> Self
pub fn ln(&self) -> Self
ln(self); caller guarantees positivity. Per-lane stack
[ln u, 1/u, -1/u²] (matches JetScalar::ln truncated to order 2).
Sourcepub fn sqrt(&self) -> Self
pub fn sqrt(&self) -> Self
√self; caller guarantees positivity. Per-lane stack
[s, 0.5/s, -0.25/(u·s)] (matches JetScalar::sqrt).
Sourcepub fn recip(&self) -> Self
pub fn recip(&self) -> Self
1/self. Per-lane stack [r, -r², 2r³] (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. Per-lane
falling-factorial stack (matches JetScalar::powf).
Trait Implementations§
Source§impl<L: Clone + Lane, const K: usize> Clone for Order2Lane<L, K>
impl<L: Clone + Lane, const K: usize> Clone for Order2Lane<L, K>
Source§fn clone(&self) -> Order2Lane<L, K>
fn clone(&self) -> Order2Lane<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 Order2Lane<L, K>
Auto Trait Implementations§
impl<L, const K: usize> Freeze for Order2Lane<L, K>where
L: Freeze,
impl<L, const K: usize> RefUnwindSafe for Order2Lane<L, K>where
L: RefUnwindSafe,
impl<L, const K: usize> Send for Order2Lane<L, K>where
L: Send,
impl<L, const K: usize> Sync for Order2Lane<L, K>where
L: Sync,
impl<L, const K: usize> Unpin for Order2Lane<L, K>where
L: Unpin,
impl<L, const K: usize> UnsafeUnpin for Order2Lane<L, K>where
L: UnsafeUnpin,
impl<L, const K: usize> UnwindSafe for Order2Lane<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.