pub fn cross_sections_on_grid(
data: &ResonanceData,
energies: &[f64],
) -> Vec<CrossSections>Expand description
Compute cross-sections over a grid of energies.
Optimized batch evaluation: precomputes J-groups and per-resonance
invariants (reduced width amplitudes, penetrability at E_r) once per
resonance range, then evaluates each energy point using the cached data.
This avoids redundant group_by_j + penetrability(l, rho_r) calls
that the per-point API (cross_sections_at_energy) would repeat.
Issue #87: the precompute is hoisted above the energy loop so that
precompute_jgroups_* runs O(ranges) times total, not O(ranges × energies).
§Limitations
MLBW (Multi-Level Breit-Wigner, LRF=2) ranges use true MLBW with interference. formulas as an approximation, ignoring resonance-resonance interference. Results may be inaccurate for closely spaced or overlapping resonances.
§Arguments
data— Parsed resonance parameters from ENDF.energies— Slice of neutron energies in eV.
§Returns
Vector of cross-sections, one per energy point.