Package com.imsl.math

Class QuadraticProgramming

java.lang.Object
com.imsl.math.QuadraticProgramming

public class QuadraticProgramming extends Object
Solves the convex quadratic programming problem subject to equality or inequality constraints.

Class QuadraticProgramming is based on M.J.D. Powell's implementation of the Goldfarb and Idnani dual quadratic programming (QP) algorithm for convex QP problems subject to general linear equality/inequality constraints (Goldfarb and Idnani 1983); i.e., problems of the form

$$\mathop {\min }\limits_{x \in R^n } g^Tx + \frac{1}{2} x^THx$$

subject to

$$A_1 x = b_1$$

$$A_2 x \ge b_2$$

given the vectors \(b_1\), \(b_2\), and g, and the matrices H, \(A_1\), and \(A_2\). H is required to be positive definite. In this case, a unique x solves the problem or the constraints are inconsistent. If H is not positive definite, a positive definite perturbation of H is used in place of H. For more details, see Powell (1983, 1985).

If a perturbation of H, \(H + \alpha I\), is used in the QP problem, then \(H + \alpha I\) also should be used in the definition of the Lagrange multipliers.

If the constraints are infeasible an exception is thrown. See Example 3 where the exception is caught and printed.

See Also:
  • Constructor Details

  • Method Details

    • getSolution

      public double[] getSolution()
      Returns the solution.
    • getOptimalValue

      public double getOptimalValue()
      Returns the optimal value.
      Returns:
      a double, the optimal value.
    • getDual

      public double[] getDual()
      Returns the dual (Lagrange multipliers).
    • isNoMoreProgress

      public boolean isNoMoreProgress()
      Returns true if due to computer rounding error, a change in the variables fail to improve the objective function. Usually the solution is close to optimum.