Skip to main content

DynamicOneSeedBatch

Struct DynamicOneSeedBatch 

Source
pub struct DynamicOneSeedBatch<'arena> {
    pub base: DynamicOrder2<'arena>,
    /* private fields */
}
Expand description

Runtime-sized batch of one-seed contractions sharing one order-two base.

Lane l is algebraically identical to a standalone DynamicOneSeed seeded by direction u_l, but the value/gradient/Hessian base is evaluated once rather than once per direction. The output lane’s epsilon Hessian is sum_c d³f/(dx_a dx_b dx_c) u_l[c].

Fields§

§base: DynamicOrder2<'arena>

Shared value/gradient/Hessian channels.

Implementations§

Source§

impl<'arena> DynamicOneSeedBatch<'arena>

Source

pub fn seed_directions( x: f64, axis: usize, dimension: usize, workspace: &'arena DynamicJetBatchWorkspace, direction_at: impl FnMut(usize) -> f64, ) -> Self

Seed one primary across every direction lane.

Source

pub fn lanes(&self) -> usize

Number of simultaneous contraction directions.

Source

pub fn contracted_third(&self, lane: usize) -> &[f64]

Row-major contracted-third matrix for one direction lane.

Trait Implementations§

Source§

impl<'arena> Clone for DynamicOneSeedBatch<'arena>

Source§

fn clone(&self) -> DynamicOneSeedBatch<'arena>

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<'arena> Copy for DynamicOneSeedBatch<'arena>

Source§

impl<'arena> Debug for DynamicOneSeedBatch<'arena>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'arena> RuntimeJetScalar<'arena> for DynamicOneSeedBatch<'arena>

Source§

fn weighted_compose_sum( lefts: &[Self], right: &Self, derivative_stacks: &[[f64; 5]], addend: &Self, ) -> Self

addend + Σ_i L_i · f_i(R) with ONE shared composition point, lane by lane, on top of the base type’s fused form.

The nilpotent part of f_i(R) is f_i'(R.base)·R.eps_l, so lane l is

addend.eps_l + Σ_i L_i.base·f_i'(R.base)·R.eps_l + Σ_i L_i.eps_l·f_i(R.base)
             = R.eps_l · [Σ_i L_i.base·f_i'(R.base)]  +  Σ_i L_i.eps_l·f_i(R.base)

and BOTH bracketed sums are the base type’s weighted_compose_sum at the same point R.base — the first with the derivative stacks shifted by one, the second with the stacks themselves. The first does not depend on the lane, so it is formed once for the whole batch. The loop this replaces wrote 2N blocks in EVERY lane and in the base; this writes two shared blocks plus three per lane (gam#979).

Source§

type Workspace = DynamicJetBatchWorkspace

Storage arena used by runtime-backed scalars. Fixed derivative oracles use the unit type because their storage is inline.
Source§

fn constant( c: f64, dimension: usize, workspace: &'arena DynamicJetBatchWorkspace, ) -> Self

A constant in a dimension-primary algebra.
Source§

fn variable( x: f64, axis: usize, dimension: usize, workspace: &'arena DynamicJetBatchWorkspace, ) -> Self

A seeded variable in a dimension-primary algebra.
Source§

fn constant_like(&self, c: f64) -> Self

A constant in the same runtime algebra as self. Read more
Source§

fn with_value(&self, value: f64) -> Self

Replace only the primal value, preserving every derivative channel.
Source§

fn dimension(&self) -> usize

Number of primary derivative axes carried by this scalar.
Source§

fn value(&self) -> f64

Value channel.
Source§

fn add(&self, other: &Self) -> Self

Exact truncated sum.
Source§

fn sub(&self, other: &Self) -> Self

Exact truncated difference.
Source§

fn mul(&self, other: &Self) -> Self

Exact truncated product.
Source§

fn multiply_add(&self, right: &Self, addend: &Self) -> Self

Evaluate self * right + addend in one semantic primitive.
Source§

fn linear_combination( inputs: &[Self], weights: &[f64], dimension: usize, workspace: &'arena DynamicJetBatchWorkspace, ) -> Self

Evaluate sum_i weights[i] * inputs[i] in one semantic primitive.
Source§

fn affine_composed_sum( inputs: &[Self], input_scales: &[f64], derivative_stacks: &[[f64; 5]], dimension: usize, workspace: &'arena DynamicJetBatchWorkspace, ) -> Self

Sum unary compositions whose inputs each carry an affine scale.
Source§

fn neg(&self) -> Self

Negate every channel.
Source§

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

Scale every channel.
Source§

fn compose_unary(&self, derivatives: [f64; 5]) -> Self

Exact unary composition from the certified derivative stack.
Source§

fn symmetric_quadratic_form<C: SymmetricQuadraticCoefficients>( inputs: &[Self], coefficients: &C, dimension: usize, workspace: &'arena Self::Workspace, ) -> Self

Evaluate inputs' A inputs from the same universal semantic primitive as JetScalar::symmetric_quadratic_form.
Source§

fn add_constant(&self, constant: f64) -> Self

Add a primal constant without changing derivative channels.
Source§

fn composed_sum( inputs: &[Self], derivative_stacks: &[[f64; 5]], dimension: usize, workspace: &'arena Self::Workspace, ) -> Self

Sum unary compositions directly from certified derivative stacks.
Source§

fn product(&self, right: &Self) -> Self

Exact product as an explicit compiled graph node.
Source§

fn affine_compose( &self, input_scale: f64, input_shift: f64, derivative_stack: [f64; 5], ) -> Self

Compose a certified outer stack after an affine input map.
Source§

fn shared_multiply_add_affine_composed_sum<const N: usize>( lefts: &[&Self; N], right: &Self, addend: &Self, addend_scales: &[f64; N], input_scales: &[f64; N], derivative_stacks: &[[f64; 5]; N], dimension: usize, workspace: &'arena Self::Workspace, ) -> Self

Runtime-dimension lowering of Σ_i f_i(input_scale_i · (left_i · right + addend_scale_i · addend)) from certified derivative stacks. Const expression arity replaces an implementation-specific term cap, while shared operands expose universal common-subexpression elimination. If every addend scale is exact zero (including -0.0), the addend has no dimension, workspace, or derivative-channel obligations.
Source§

fn exp(&self) -> Self

e^self.
Source§

fn ln(&self) -> Self

ln(self). Caller guarantees positivity. This is the runtime-width counterpart of JetScalar::ln and uses the identical certified derivative stack.
Source§

fn recip(&self) -> Self

1/self.

Auto Trait Implementations§

§

impl<'arena> !RefUnwindSafe for DynamicOneSeedBatch<'arena>

§

impl<'arena> !Send for DynamicOneSeedBatch<'arena>

§

impl<'arena> !Sync for DynamicOneSeedBatch<'arena>

§

impl<'arena> !UnwindSafe for DynamicOneSeedBatch<'arena>

§

impl<'arena> Freeze for DynamicOneSeedBatch<'arena>

§

impl<'arena> Unpin for DynamicOneSeedBatch<'arena>

§

impl<'arena> UnsafeUnpin for DynamicOneSeedBatch<'arena>

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<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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.