public class QuadraticProgramming extends Object
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
subject to
given the vectors , , and g, and the matrices H, , and . 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, , is used in the QP problem, then 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.
Modifier and Type  Class and Description 

static class 
QuadraticProgramming.InconsistentSystemException
The system of constraints is inconsistent.

static class 
QuadraticProgramming.NoLPSolutionException
No solution for the LP problem with h = 0 was found by
DenseLP . 
static class 
QuadraticProgramming.ProblemUnboundedException
The object value for the problem is unbounded.

static class 
QuadraticProgramming.SolutionNotFoundException
A solution was not found.

Modifier and Type  Field and Description 

static double 
EPSILON_SMALL
The smallest relative spacing for doubles.

Constructor and Description 

QuadraticProgramming(double[][] h,
double[] g,
double[][] aEquality,
double[] bEquality,
double[][] aInequality,
double[] bInequality)
Solve a quadratic programming problem.

Modifier and Type  Method and Description 

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

double 
getOptimalValue()
Returns the optimal value.

double[] 
getSolution()
Returns the solution.

boolean 
isNoMoreProgress()
Returns true if due to computer rounding error, a
change in the variables fail to improve the objective
function.

public static final double EPSILON_SMALL
public QuadraticProgramming(double[][] h, double[] g, double[][] aEquality, double[] bEquality, double[][] aInequality, double[] bInequality) throws QuadraticProgramming.InconsistentSystemException, QuadraticProgramming.ProblemUnboundedException, QuadraticProgramming.NoLPSolutionException, QuadraticProgramming.SolutionNotFoundException
h
 is square array containing the Hessian. It must be positive definite.g
 contains the coefficients of the linear term of the objective function.aEquality
 is a rectangular matrix containing the equality constraints.
It can be null if there are no equality constraints.bEquality
 contains the rightside of the equality constraints.
It can be null if there are no equality constraints.aInequality
 is a rectangular matrix containing the inequality constraints.
It can be null if there are no inequality constraints.bInequality
 contains the rightside of the inequality constraints.
It can be null if there are no inequality constraints.QuadraticProgramming.InconsistentSystemException
 if the system of constraints is
inconsistent and there is no solution.QuadraticProgramming.ProblemUnboundedException
QuadraticProgramming.NoLPSolutionException
QuadraticProgramming.SolutionNotFoundException
public double[] getDual()
public double getOptimalValue()
double
, the optimal value.public double[] getSolution()
public boolean isNoMoreProgress()
Copyright © 19702015 Rogue Wave Software
Built October 13 2015.