pub fn solve_flat<T: Real>(
q: &[T],
k0: &[T],
layers: &[LayerCoeffs<T>],
n_layers: usize,
parallel: bool,
) -> Result<Vec<PointResult<T>>>Expand description
Solves many stacks of equal depth against a shared q-grid.
This is the batched entry point shaped for accelerator dispatch: inputs
are flat, row-major buffers and every (stack, q) pair is independent.
§Parameters
q: scattering vectors in1/Angstrom, lengthn_q.k0: vacuum wavenumber per stack in1/Angstrom, lengthn_stacks.layers: row-major(n_stacks, n_layers)buffer of layer records.n_layers: depth of every stack, at least two.parallel: distribute(stack, q)pairs across rayon when true.
§Returns
Row-major (n_stacks, n_q) results.
§Errors
[RefloxideError::InvalidShape] when layers.len() != n_stacks * n_layers
or n_layers < 2; [RefloxideError::SingularDynamicMatrix] with
energy_index set to the stack index and q_index to the q index.