pub fn detect_soc(
arena: &ExprArena,
vars: &[Variable],
c: &Constraint,
) -> Option<SocForm>Expand description
Recognize an algebraic quadratic constraint as second-order-cone shaped.
A constraint is recognized iff:
- it is single-sided
lhs <= rhs(no ranges,>=, or equalities), lhs - rhsis a pure quadratic form: no linear terms, no constant,- the Hessian is diagonal with exactly one negative entry
-n(on the bound variablet) and at least one positive entryp_i, thas lower bound>= 0.
That is sum_i p_i x_i^2 <= n t^2 with t >= 0, equivalent to
|| sqrt(p_i/n) x_i ||_2 <= t. Cross-term (Cholesky-factorized) quadratic
forms are not detected, they classify as QCP instead.