pub struct DynamicOrder2Accumulator { /* private fields */ }Expand description
Allocation-minimal runtime-width lowering of an additive order-two program.
This is the dynamic-width sibling of MappedOrder2Accumulator. A caller
first reduces its mathematical row program to a scalar value plus N
independent composed sources. This accumulator then performs the universal
chain rule
g_i = sum_t (f_t' q_t,i)
H_ij = sum_t (f_t'' q_t,i q_t,j + f_t' q_t,ij)in one gradient pass and one upper-triangular Hessian pass. It owns exactly
the two buffers that become the returned gradient and Hessian; no per-term
derivative buffer or jet temporary is allocated. N is const-generic so a
small fixed source set is visible to LLVM and can be unrolled.
Implementations§
Source§impl DynamicOrder2Accumulator
impl DynamicOrder2Accumulator
Sourcepub fn from_composed_sum<T: DynamicOrder2Term, const N: usize>(
dimension: usize,
value: f64,
terms: &[T; N],
) -> Self
pub fn from_composed_sum<T: DynamicOrder2Term, const N: usize>( dimension: usize, value: f64, terms: &[T; N], ) -> Self
Lower a fused additive source set at runtime primary width dimension.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DynamicOrder2Accumulator
impl RefUnwindSafe for DynamicOrder2Accumulator
impl Send for DynamicOrder2Accumulator
impl Sync for DynamicOrder2Accumulator
impl Unpin for DynamicOrder2Accumulator
impl UnsafeUnpin for DynamicOrder2Accumulator
impl UnwindSafe for DynamicOrder2Accumulator
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.