residue_id ¤
Stage 2: Residue identification via weighted least squares.
Ported from vectfit4.m lines 542–750 (SINTEF MFT-NNLS, B. Gustavsen, 2026).
The core computation is a per-element LS solve: for each of the nnn upper-triangle elements, find residues C, and optionally D and E terms, given fixed poles. This is the primary vmap target: each element is independent.
Functions:
| Name | Description |
|---|---|
identify_residues | Identify residues (and D, E terms) for all upper-triangle elements. |
identify_residues ¤
identify_residues(
f: ndarray, s: ndarray, poles: ndarray, weight: ndarray, opts
) -> tuple[ndarray, ndarray, ndarray]
Identify residues (and D, E terms) for all upper-triangle elements.
Returns:
| Name | Type | Description |
|---|---|---|
C | ndarray | (nnn, N) complex — residues for each element and each pole. |
D_vec | ndarray | (nnn,) float — constant terms (zero if opts.asymp == 1). |
E_vec | ndarray | (nnn,) float — linear terms (zero if opts.asymp < 3). |