map_operator
Stable type · The operator interface
Tier: stable · Kind: type · Topic: The operator interface
| Julia | Rust |
|---|---|
| not exported | operator::MapOperator |
Julia
Julia does not export this type.
Rust
pub trait MapOperator<T: Scalar>: Send + Sync {
fn name(&self) -> &str;
fn writes(&self) -> Vec<usize>;
fn apply(&self, out: &mut [T], u: &[T], p: &[f64], t: f64, dt: f64, mask: &mut Vec<u8>);
fn apply_frozen(&self, out: &mut [T], u: &[T], p: &[f64], t: f64, dt: f64, mask: &[u8]);
fn map_vjp(&self, out_u: &mut [T], out_p: &mut [f64], u: &[T], p: &[f64], t: f64, dt: f64, mask: &[u8], w: &[T]);
fn map_jvp(&self, out: &mut [T], u: &[T], p: &[f64], t: f64, dt: f64, mask: &[u8], v_u: &[T], v_p: &[f64]);
}
A map operator u ← M(u, p, t, Δ) (§7).
The mask records the discrete decisions apply takes, as one byte per
decision; the adjoint holds them fixed (spec/adjoint.md §5.7).