Module scalar
Expand description
The pricing scalar: which AD modes this crate prices in, and how stored passive parameters are lifted into one.
Storage holds f64. A view holds the mode’s scalar. For the passive mode
those are the same type and the view should borrow the stored slice; for
every active mode it must own a converted copy. Rust cannot express that
choice generically — &[f64] and &[R] unify only when R = f64 — so the
decision is made once per mode here, behind one method.
This is what keeps the value-only path free of a per-curve allocation while the same code serves every active mode.
Macros§
- impl_
owning_ 🔒lift - Stamp an owning lift for an active mode. Each converts through
From<f64>, which is where a reverse-mode scalar acquires its (as yet unregistered) slot and a forward-mode dual its zero tangent.
Traits§
- Lift
Params - A pricing mode that stored
f64parameters can be lifted into. - Scalar
- The bound every pricing body in this crate is written against.