Struct ScatteringInterpolationTable
pub struct ScatteringInterpolationTable { /* private fields */ }Expand description
Precomputed scattering matrices at log-spaced pot positions.
At compile time, sweeps the pot through K positions and computes full-precision scattering matrices. At runtime, binary search + linear interpolation replaces O(n³) matrix inversion with O(n²) lerp.
Implementations§
§impl ScatteringInterpolationTable
impl ScatteringInterpolationTable
pub fn build(
mna: &MnaSystem,
pot_node_pos: Option<usize>,
pot_node_neg: Option<usize>,
initial_g: f64,
r_min: f64,
r_max: f64,
ports: &[WdfPort],
vs_idx: Option<usize>,
k: usize,
) -> ScatteringInterpolationTable
pub fn build( mna: &MnaSystem, pot_node_pos: Option<usize>, pot_node_neg: Option<usize>, initial_g: f64, r_min: f64, r_max: f64, ports: &[WdfPort], vs_idx: Option<usize>, k: usize, ) -> ScatteringInterpolationTable
Build a table by sweeping the pot through K log-spaced positions.
mna: base MNA system (pot already stamped at initial_g)pot_node_pos,pot_node_neg: MNA node indices for the potinitial_g: current pot conductance stamped in the MNA G matrixr_min,r_max: pot resistance range (typically 1.0 to max_resistance)ports: WDF port definitions (reactive ports, no pot port)vs_idx: voltage source index for VS injection (None for standard mode)k: number of table entries
pub fn lookup(&self, pot_resistance: f64) -> (Vec<f64>, Vec<f64>)
pub fn lookup(&self, pot_resistance: f64) -> (Vec<f64>, Vec<f64>)
Look up scattering matrix and VS injection vector by interpolating in log-resistance space. Returns (scattering, vs_injection).
pub fn has_vs_injection(&self) -> bool
pub fn has_vs_injection(&self) -> bool
Returns true when VS injection vectors are non-trivial (any entry != 0).
pub fn resistances(&self) -> &[f64]
pub fn resistances(&self) -> &[f64]
Log-spaced resistance samples (ascending).
pub fn matrices(&self) -> &[Vec<f64>]
pub fn matrices(&self) -> &[Vec<f64>]
Scattering matrices, one per resistance sample, each n_ports² entries.
pub fn injections(&self) -> &[Vec<f64>]
pub fn injections(&self) -> &[Vec<f64>]
VS injection vectors, one per resistance sample, each n_ports entries.
Auto Trait Implementations§
impl Freeze for ScatteringInterpolationTable
impl RefUnwindSafe for ScatteringInterpolationTable
impl Send for ScatteringInterpolationTable
impl Sync for ScatteringInterpolationTable
impl Unpin for ScatteringInterpolationTable
impl UnsafeUnpin for ScatteringInterpolationTable
impl UnwindSafe for ScatteringInterpolationTable
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