pub struct NamedJet1Vec<T: Passive = f64> { /* private fields */ }Expand description
Labeled wrapper around the positional Jet1Vec type.
§Example
The constructor API for NamedJet1Vec is owned by NamedForwardTape
via the declare_jet1vec / into_scope / scope.jet1vec(handle) pattern.
See the module docs in src/forward_tape.rs for the full rationale.
use xad_rs::{NamedForwardTape, NamedForwardScope};
let mut ft = NamedForwardTape::new();
let x_h = ft.declare_jet1vec("x", 2.0);
let y_h = ft.declare_jet1vec("y", 3.0);
let scope: NamedForwardScope = ft.into_scope();
let x = scope.jet1vec(x_h);
let y = scope.jet1vec(y_h);
let f = x * y + x - 2.0 * y;
assert_eq!(f.real(), 2.0);
assert_eq!(f.partial("x"), 4.0);
assert_eq!(f.partial("y"), 0.0);Implementations§
Source§impl<T: Passive> NamedJet1Vec<T>
impl<T: Passive> NamedJet1Vec<T>
Sourcepub fn partial(&self, name: &str) -> T
pub fn partial(&self, name: &str) -> T
Partial derivative with respect to a named variable.
Reads the active registry from the NamedForwardTape thread-local
slot (stamped at freeze() time). Returns 0.0 if name is
in the registry but not touched by this value (same as positional
Jet1Vec::partial on an unused slot). Panics if name is not in the
registry, or if called outside a frozen NamedForwardTape scope.
Sourcepub fn gradient(&self) -> Vec<(String, T)>
pub fn gradient(&self) -> Vec<(String, T)>
Full gradient as a Vec<(name, partial)>.
Iteration order matches the active registry’s insertion order —
deterministic. Reads the active registry from the thread-local slot.
Panics if called outside a frozen NamedForwardTape scope.
Sourcepub fn inner(&self) -> &Jet1Vec<T>
pub fn inner(&self) -> &Jet1Vec<T>
Escape hatch: direct access to the inner positional Jet1Vec.
Sourcepub fn inv_norm_cdf(&self) -> Self
pub fn inv_norm_cdf(&self) -> Self
Inverse standard normal CDF, preserving the parent scope’s generation.
Trait Implementations§
Source§impl<T: Passive> Add<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Add<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn add(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl<T: Passive> Add<&NamedJet1Vec<T>> for NamedJet1Vec<T>
impl<T: Passive> Add<&NamedJet1Vec<T>> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn add(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl Add<&NamedJet1Vec<f32>> for f32
impl Add<&NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
+ operator.Source§fn add(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn add(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
+ operation. Read moreSource§impl Add<&NamedJet1Vec> for f64
impl Add<&NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
+ operator.Source§fn add(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn add(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
+ operation. Read moreSource§impl<T: Passive> Add<NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Add<NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn add(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl Add<NamedJet1Vec<f32>> for f32
impl Add<NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
+ operator.Source§fn add(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn add(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
+ operation. Read moreSource§impl Add<NamedJet1Vec> for f64
impl Add<NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
+ operator.Source§fn add(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn add(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
+ operation. Read moreSource§impl<T: Passive> Add<T> for &NamedJet1Vec<T>
impl<T: Passive> Add<T> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: T) -> NamedJet1Vec<T>
fn add(self, rhs: T) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl<T: Passive> Add<T> for NamedJet1Vec<T>
impl<T: Passive> Add<T> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: T) -> NamedJet1Vec<T>
fn add(self, rhs: T) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl<T: Passive> Add for NamedJet1Vec<T>
impl<T: Passive> Add for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
+ operator.Source§fn add(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn add(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
+ operation. Read moreSource§impl<T: Passive> AddAssign<&NamedJet1Vec<T>> for NamedJet1Vec<T>
impl<T: Passive> AddAssign<&NamedJet1Vec<T>> for NamedJet1Vec<T>
Source§fn add_assign(&mut self, rhs: &NamedJet1Vec<T>)
fn add_assign(&mut self, rhs: &NamedJet1Vec<T>)
+= operation. Read moreSource§impl<T: Passive> AddAssign for NamedJet1Vec<T>
impl<T: Passive> AddAssign for NamedJet1Vec<T>
Source§fn add_assign(&mut self, rhs: NamedJet1Vec<T>)
fn add_assign(&mut self, rhs: NamedJet1Vec<T>)
+= operation. Read moreSource§impl<T: Clone + Passive> Clone for NamedJet1Vec<T>
impl<T: Clone + Passive> Clone for NamedJet1Vec<T>
Source§fn clone(&self) -> NamedJet1Vec<T>
fn clone(&self) -> NamedJet1Vec<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Passive> Display for NamedJet1Vec<T>
impl<T: Passive> Display for NamedJet1Vec<T>
Source§impl<T: Passive> Div<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Div<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn div(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl<T: Passive> Div<&NamedJet1Vec<T>> for NamedJet1Vec<T>
impl<T: Passive> Div<&NamedJet1Vec<T>> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn div(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl Div<&NamedJet1Vec<f32>> for f32
impl Div<&NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
/ operator.Source§fn div(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn div(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
/ operation. Read moreSource§impl Div<&NamedJet1Vec> for f64
impl Div<&NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
/ operator.Source§fn div(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn div(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
/ operation. Read moreSource§impl<T: Passive> Div<NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Div<NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn div(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl Div<NamedJet1Vec<f32>> for f32
impl Div<NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
/ operator.Source§fn div(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn div(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
/ operation. Read moreSource§impl Div<NamedJet1Vec> for f64
impl Div<NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
/ operator.Source§fn div(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn div(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
/ operation. Read moreSource§impl<T: Passive> Div<T> for &NamedJet1Vec<T>
impl<T: Passive> Div<T> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: T) -> NamedJet1Vec<T>
fn div(self, rhs: T) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl<T: Passive> Div<T> for NamedJet1Vec<T>
impl<T: Passive> Div<T> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: T) -> NamedJet1Vec<T>
fn div(self, rhs: T) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl<T: Passive> Div for NamedJet1Vec<T>
impl<T: Passive> Div for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
/ operator.Source§fn div(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn div(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
/ operation. Read moreSource§impl<T: Passive> Mul<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Mul<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn mul(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
* operation. Read moreSource§impl<T: Passive> Mul<&NamedJet1Vec<T>> for NamedJet1Vec<T>
impl<T: Passive> Mul<&NamedJet1Vec<T>> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn mul(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
* operation. Read moreSource§impl Mul<&NamedJet1Vec<f32>> for f32
impl Mul<&NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
* operator.Source§fn mul(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn mul(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
* operation. Read moreSource§impl Mul<&NamedJet1Vec> for f64
impl Mul<&NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
* operator.Source§fn mul(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn mul(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
* operation. Read moreSource§impl<T: Passive> Mul<NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Mul<NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn mul(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
* operation. Read moreSource§impl Mul<NamedJet1Vec<f32>> for f32
impl Mul<NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
* operator.Source§fn mul(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn mul(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
* operation. Read moreSource§impl Mul<NamedJet1Vec> for f64
impl Mul<NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
* operator.Source§fn mul(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn mul(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
* operation. Read moreSource§impl<T: Passive> Mul<T> for &NamedJet1Vec<T>
impl<T: Passive> Mul<T> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: T) -> NamedJet1Vec<T>
fn mul(self, rhs: T) -> NamedJet1Vec<T>
* operation. Read moreSource§impl<T: Passive> Mul<T> for NamedJet1Vec<T>
impl<T: Passive> Mul<T> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: T) -> NamedJet1Vec<T>
fn mul(self, rhs: T) -> NamedJet1Vec<T>
* operation. Read moreSource§impl<T: Passive> Mul for NamedJet1Vec<T>
impl<T: Passive> Mul for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
* operator.Source§fn mul(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn mul(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
* operation. Read moreSource§impl<T: Passive> Neg for &NamedJet1Vec<T>
impl<T: Passive> Neg for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn neg(self) -> NamedJet1Vec<T>
fn neg(self) -> NamedJet1Vec<T>
- operation. Read moreSource§impl<T: Passive> Neg for NamedJet1Vec<T>
impl<T: Passive> Neg for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn neg(self) -> NamedJet1Vec<T>
fn neg(self) -> NamedJet1Vec<T>
- operation. Read moreSource§impl<T: Passive> Sub<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Sub<&NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn sub(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
- operation. Read moreSource§impl<T: Passive> Sub<&NamedJet1Vec<T>> for NamedJet1Vec<T>
impl<T: Passive> Sub<&NamedJet1Vec<T>> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn sub(self, rhs: &NamedJet1Vec<T>) -> NamedJet1Vec<T>
- operation. Read moreSource§impl Sub<&NamedJet1Vec<f32>> for f32
impl Sub<&NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
- operator.Source§fn sub(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn sub(self, rhs: &NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
- operation. Read moreSource§impl Sub<&NamedJet1Vec> for f64
impl Sub<&NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
- operator.Source§fn sub(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn sub(self, rhs: &NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
- operation. Read moreSource§impl<T: Passive> Sub<NamedJet1Vec<T>> for &NamedJet1Vec<T>
impl<T: Passive> Sub<NamedJet1Vec<T>> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn sub(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
- operation. Read moreSource§impl Sub<NamedJet1Vec<f32>> for f32
impl Sub<NamedJet1Vec<f32>> for f32
Source§type Output = NamedJet1Vec<f32>
type Output = NamedJet1Vec<f32>
- operator.Source§fn sub(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
fn sub(self, rhs: NamedJet1Vec<f32>) -> NamedJet1Vec<f32>
- operation. Read moreSource§impl Sub<NamedJet1Vec> for f64
impl Sub<NamedJet1Vec> for f64
Source§type Output = NamedJet1Vec
type Output = NamedJet1Vec
- operator.Source§fn sub(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
fn sub(self, rhs: NamedJet1Vec<f64>) -> NamedJet1Vec<f64>
- operation. Read moreSource§impl<T: Passive> Sub<T> for &NamedJet1Vec<T>
impl<T: Passive> Sub<T> for &NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: T) -> NamedJet1Vec<T>
fn sub(self, rhs: T) -> NamedJet1Vec<T>
- operation. Read moreSource§impl<T: Passive> Sub<T> for NamedJet1Vec<T>
impl<T: Passive> Sub<T> for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: T) -> NamedJet1Vec<T>
fn sub(self, rhs: T) -> NamedJet1Vec<T>
- operation. Read moreSource§impl<T: Passive> Sub for NamedJet1Vec<T>
impl<T: Passive> Sub for NamedJet1Vec<T>
Source§type Output = NamedJet1Vec<T>
type Output = NamedJet1Vec<T>
- operator.Source§fn sub(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
fn sub(self, rhs: NamedJet1Vec<T>) -> NamedJet1Vec<T>
- operation. Read more