KktResidual<T>
Models & Types · AiDotNet.Solvers
How badly a candidate point violates each of the Karush-Kuhn-Tucker optimality conditions.
How It Works
All four residuals are zero exactly when the point, together with its multipliers, satisfies the KKT conditions. For a convex problem that is both necessary and sufficient for optimality, so these numbers constitute a certificate: a solver’s answer can be checked independently of the solver that produced it.
Constructors
| Constructor | Summary |
|---|---|
KktResidual(T stationarity, T primalFeasibility, T dualFeasibility, T complementarySlackness, T worst) |
Creates a KKT residual report. |
Properties
| Property | Summary |
|---|---|
T ComplementarySlackness { get; } |
Gets the largest absolute value of λ_i · (a_iᵀx − b_i) over the inequality constraints. |
T DualFeasibility { get; } |
Gets the worst negative inequality multiplier, as a non-negative magnitude. |
T PrimalFeasibility { get; } |
Gets the worst violation of the constraints themselves — how far outside the feasible region the point sits. |
T Stationarity { get; } |
Gets the largest absolute component of ∇f(x) + Aᵀ_eq·ν + Aᵀ_ub·λ. |
T Worst { get; } |
Gets the largest of the four residuals. |