jml.optimization
Class GeneralQP

java.lang.Object
  extended by jml.optimization.GeneralQP

public class GeneralQP
extends java.lang.Object

General quadratic programming:

min 2 \ x' * Q * x + c' * x
s.t. A * x = b
B * x <= d

Version:
1.0 Feb. 27th, 2013
Author:
Mingjie Qian

Constructor Summary
GeneralQP()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static PhaseIResult phaseI(org.apache.commons.math.linear.RealMatrix A, org.apache.commons.math.linear.RealMatrix b, org.apache.commons.math.linear.RealMatrix B, org.apache.commons.math.linear.RealMatrix d)
          We demonstrate the implementation of phase I via primal-dual interior point method to test whether the following problem is feasible:
static QPSolution phaseII(org.apache.commons.math.linear.RealMatrix Q, org.apache.commons.math.linear.RealMatrix c, org.apache.commons.math.linear.RealMatrix A, org.apache.commons.math.linear.RealMatrix b, org.apache.commons.math.linear.RealMatrix B, org.apache.commons.math.linear.RealMatrix d, org.apache.commons.math.linear.RealMatrix x0)
          Phase II for solving a general quadratic programming problem formulated as
static QPSolution solve(org.apache.commons.math.linear.RealMatrix Q, org.apache.commons.math.linear.RealMatrix c, org.apache.commons.math.linear.RealMatrix A, org.apache.commons.math.linear.RealMatrix b, org.apache.commons.math.linear.RealMatrix B, org.apache.commons.math.linear.RealMatrix d)
          Solve a general quadratic programming problem formulated as
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneralQP

public GeneralQP()
Method Detail

main

public static void main(java.lang.String[] args)
Parameters:
args -

solve

public static QPSolution solve(org.apache.commons.math.linear.RealMatrix Q,
                               org.apache.commons.math.linear.RealMatrix c,
                               org.apache.commons.math.linear.RealMatrix A,
                               org.apache.commons.math.linear.RealMatrix b,
                               org.apache.commons.math.linear.RealMatrix B,
                               org.apache.commons.math.linear.RealMatrix d)
Solve a general quadratic programming problem formulated as

min 2 \ x' * Q * x + c' * x
s.t. A * x = b
B * x <= d

Parameters:
Q - an n x n positive definite or semi-definite matrix
c - an n x 1 real matrix
A - a p x n real matrix
b - a p x 1 real matrix
B - an m x n real matrix
d - an m x 1 real matrix
Returns:
a QPSolution instance if the general QP problems is feasible or null otherwise

phaseI

public static PhaseIResult phaseI(org.apache.commons.math.linear.RealMatrix A,
                                  org.apache.commons.math.linear.RealMatrix b,
                                  org.apache.commons.math.linear.RealMatrix B,
                                  org.apache.commons.math.linear.RealMatrix d)
We demonstrate the implementation of phase I via primal-dual interior point method to test whether the following problem is feasible:

min f(x)
s.t. A * x = b
B * x <= d

We seek the optimizer for the following phase I problem:

min 1's
s.t. A * x = b
B * x - d <= s
s >= 0

<=>
min cI'y
s.t. AI * y = b
BI * y <= dI

cI = [zeros(n, 1); ones(m, 1)]
AI = [A zeros(p, m)]
BI = [B -eye(m); zeros(m, n) -eye(m)]
dI = [d; zeros(m, 1)]
y = [x; s]

Parameters:
A - a p x n real matrix
b - a p x 1 real matrix
B - an m x n real matrix
d - an m x 1 real matrix
Returns:
a PhaseIResult instance if feasible or null if infeasible

phaseII

public static QPSolution phaseII(org.apache.commons.math.linear.RealMatrix Q,
                                 org.apache.commons.math.linear.RealMatrix c,
                                 org.apache.commons.math.linear.RealMatrix A,
                                 org.apache.commons.math.linear.RealMatrix b,
                                 org.apache.commons.math.linear.RealMatrix B,
                                 org.apache.commons.math.linear.RealMatrix d,
                                 org.apache.commons.math.linear.RealMatrix x0)
Phase II for solving a general quadratic programming problem formulated as

min 2 \ x' * Q * x + c' * x
s.t. A * x = b
B * x <= d

Parameters:
Q - an n x n positive definite or semi-definite matrix
c - an n x 1 real matrix
A - a p x n real matrix
b - a p x 1 real matrix
B - an m x n real matrix
d - an m x 1 real matrix
x0 - starting point
Returns:
a QPSolution instance