Package jline.api.mam

Class M3a_qp

java.lang.Object
jline.api.mam.M3a_qp

public final class M3a_qp extends Object
Exact solver for the strictly convex quadratic programs of the M3A fitters, the counterpart of matlab/lib/m3a/lib/thirdparty/QP/QP.m:
   min 0.5 x'Hx + f'x   s.t.  Ai x <= bi,  Ae x = be,  lb <= x <= ub
 

MATLAB solves these with the Goldfarb-Idnani dual active-set method, which terminates at the exact optimum. This is the same method: start from the unconstrained minimizer, add the equalities, then repeatedly add the most violated inequality, dropping any active inequality whose multiplier would turn negative. Each step recomputes the primal and dual directions from the KKT system of the current active set, which is affordable because the M3A programs have at most a few dozen variables. Because the program is strictly convex its optimum is unique, so the answer agrees with MATLAB's to rounding; an iterative solver such as OSQP stops at its own tolerance instead, and that is what made the JAR fitters disagree with MATLAB in the fourth digit.

Linearly dependent equality rows are allowed as long as they are consistent (the M3A marking programs pass two proportional rows), mirroring the 'Rank deficient Feasible Equality Constraints' outcome of MATLAB's ReduceQP.

  • Method Details

    • qp

      public static QPResult qp(double[][] H, double[] f, double[][] Ai, double[] bi, double[][] Ae, double[] be, double[] lb, double[] ub)
      Solves the program. Any of Ai/bi, Ae/be, lb, ub may be null.
      Returns:
      the solution; QPResult.success is false when the program is infeasible