Skip to main content

select_regime

Function select_regime 

Source
pub fn select_regime(n_residuals: usize, n_params: usize) -> StepKind
Expand description

Choose the step factorization path from the problem shape.

  • Many parameters (p > 40) ⇒ StepKind::SvdSecular to avoid squaring the condition number on an ill-conditioned J.
  • Tall and thin (m ≥ 8·p) ⇒ StepKind::NormalEqLlt: the JᵀJ reduction collapses the O(m) work and the p×p Cholesky is trivially cheap.
  • Otherwise default to StepKind::NormalEqLlt; a cheap conditioning probe (column-norm ratio) for escalating borderline cases is a known follow-up.

The p > 40 and m ≥ 8·p constants are documented heuristics, not tuned thresholds — revisit alongside the benchmark.