pub fn optimal_ell_width<T: GpuFloat>(row_nnz: &[usize]) -> usizeExpand description
Compute the optimal ELL width from a distribution of per-row nnz counts.
The heuristic balances two competing goals:
- Minimise ELL padding waste (favours small width).
- Minimise COO overflow volume (favours large width).
It selects the width that minimises estimated total storage cost,
modelling ELL cost as rows * width * (sizeof(i32) + sizeof(T)) and COO
cost as overflow_nnz * (2 * sizeof(i32) + sizeof(T)).
Returns 1 if row_nnz is empty.