pub(super) const RHO_INIT: f64 = 8.0;
pub(super) const DELTA_INIT: f64 = 8.0;
pub(super) const WARM_MU_MIN: f64 = 1e-8;
pub(super) const WARM_BOUND_REL_MARGIN: f64 = 1e-6;
pub(super) fn warm_bound_margin(bound: f64) -> f64 {
WARM_BOUND_REL_MARGIN * bound.abs().max(1.0)
}
pub(super) const WARM_SY_MIN: f64 = 1e-8;
pub(super) const PMM_IMPROVE_THRESHOLD: f64 = 0.95;
pub(super) const PMM_SLOW_RATE: f64 = 2.0 / 3.0;
pub(super) const MU_ZERO_THRESHOLD: f64 = 1e-15;
pub(super) const LDL_REG_RETRY_MAX: usize = 10;
pub(super) const LDL_REG_GROWTH: f64 = 10.0;
pub(super) const LDL_REG_CEILING: f64 = 1.0;
pub(super) const LDL_FALLBACK_DELTA_MIN: f64 = 1e-2;
pub(super) const DUALITY_GAP_TOL: f64 = 1e-3;
pub(super) const REG_LIMIT_MIN: f64 = 1e-14;
pub(super) const REG_LIMIT_STEP: f64 = 1e-3;
pub(super) const REG_LIMIT_INIT_QP: f64 = 5e-8;
pub(super) const REG_LIMIT_INIT_LP: f64 = 5e-10;
pub(super) const PROX_DOMINATE_RATIO: f64 = 0.5;
pub(super) const PF_HISTORY_LEN: usize = 5;
pub(super) const PF_STUCK_RATIO: f64 = 0.95;
pub(super) const PF_FAR_FROM_TARGET_RATIO: f64 = 1e2;
pub(super) const DIRECTION_BLOWUP_THRESHOLD: f64 = 1e30;
pub(super) const MIN_CONSECUTIVE_INFEAS: usize = 3;
pub(super) const STEP_REL_CAP: f64 = 1e3;
pub(super) fn alpha_stall_eps_for(eps: f64) -> f64 {
(eps * 1e-2).max(1e-14)
}
pub(super) const ALPHA_STALL_N: usize = 5;
pub(super) const ALPHA_DEADLOCK_N: usize = 20;
pub(super) const RESIDUAL_STALL_WINDOW: usize = 50;
pub(super) const RESIDUAL_STALL_REL_DEC: f64 = 1e-3;
pub(super) const ADAPTIVE_REG_C_MAX_THRESH: f64 = 1e-6;
pub(super) const GONDZIO_ALPHA_TRIGGER: f64 = 0.999;
pub(super) struct PmmState {
pub(super) x_ref: Vec<f64>,
pub(super) y_ref: Vec<f64>,
pub(super) rho: f64,
pub(super) delta: f64,
pub(super) prev_nr_p: f64,
pub(super) prev_nr_d: f64,
}