Skip to main content

classify_working_set

Function classify_working_set 

Source
pub fn classify_working_set(
    lambda_x: &[Number],
    lambda_g: &[Number],
    m_eq: usize,
    x: &[Number],
    x_l: &[Number],
    x_u: &[Number],
    g: &[Number],
    g_l: &[Number],
    g_u: &[Number],
    mult_tol: Number,
    primal_tol: Number,
) -> WorkingSet
Expand description

Classify the active set at iterate (x, λ_x, λ_g) against the supplied bounds and constraint-bound vectors.

Inputs:

  • lambda_x: packed signed bound multipliers (z_l − z_u) of length n. Positive ⇒ lower bound active; negative ⇒ upper.
  • lambda_g: stacked constraint multipliers [y_c ; y_d] of length m = m_eq + m_ineq. Same sign convention.
  • m_eq: number of equality rows at the start of lambda_g. Used to flag rows as ConsStatus::Equality without consulting g_l/g_u.
  • x, x_l, x_u: primal iterate and variable bounds, length n. The bound-classifier double-checks the primal is close to the bound (within primal_tol) — guards against the case where a multiplier is large but the primal hasn’t actually reached the bound (e.g. near-degenerate KKT or a bad multiplier estimate).
  • g, g_l, g_u: constraint values and bounds, length m. Used identically for constraint rows.
  • mult_tol: multiplier-magnitude threshold; a row whose |λ| falls below this is classified as Inactive regardless of primal distance.
  • primal_tol: distance threshold between x[i] and x_l[i] / x_u[i] (resp. g[i] vs g_l[i] / g_u[i]) below which a row is treated as “at the bound”.

Variable bounds with x_l[i] == x_u[i] are classified BoundStatus::Fixed; constraint rows in the first m_eq slots are ConsStatus::Equality. Both are unconditionally active.