Class QPProblem
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.convex.sdp.socp.qp.problem.QPProblem
-
- All Implemented Interfaces:
ConstrainedOptimProblem
,OptimProblem
public class QPProblem extends Object implements ConstrainedOptimProblem
Quadratic Programming is the problem of optimizing (minimizing) a quadratic function of several variables subject to linear constraints on these variables. The standard form, following the convention in the reference, is: \[ \min_x \left \{ \frac{1}{2} \times x'Hx + x'p \right \} \\ Ax \geq b, A_{eq}x = b_{eq} \]- See Also:
- Wikipedia: Quadratic programming
- "Andreas Antoniou, Wu-Sheng Lu, "Chapter 13, Quadratic and Convex Programming," Practical Optimization: Algorithms and Engineering Applications."
-
-
Constructor Summary
Constructors Constructor Description QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater)
Construct a quadratic programming problem with linear equality and greater-than-or-equal-to constraints.QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
Construct a quadratic programming problem.QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear equality and less-than-or-equal-to constraints.QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater)
Construct a quadratic programming problem with linear greater-than-or-equal-to constraints.QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear inequality constraints.QPProblem(QuadraticFunction f, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear less-than-or-equal-to constraints.QPProblem(QPProblem that)
Copy constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ImmutableMatrix
A()
Get the coefficients of the inequality constraints: A as in \(Ax \geq b\).ImmutableMatrix
Aeq()
Get the coefficients of the equality constraints: Aeq as in \(A_{eq}x = b_{eq}\).ImmutableVector
b()
Get the values of the inequality constraints: b as in \(Ax \geq b\).ImmutableVector
beq()
Get the values of the equality constraints: beq as in \(A_{eq}x = b_{eq}\).int
dimension()
Get the number of variables.QuadraticFunction
f()
Get the objective function.LinearEqualityConstraints
getEqualityConstraints()
Gets the equality constraints, hi(x) = 0LinearGreaterThanConstraints
getGreaterThanConstraints()
Get the set of linear greater-than-or-equal-to constraints.LinearLessThanConstraints
getLessThanConstraints()
Gets the less-than-or-equal-to constraints, gi(x) ≤ 0
-
-
-
Constructor Detail
-
QPProblem
public QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
Construct a quadratic programming problem.- Parameters:
f
- the quadratic objective function to be minimizedequal
- the linear equality constraintsgreater
- the linear greater-than-or-equal-to constraintsless
- the linear less-than-or-equal-to constraints
-
QPProblem
public QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear inequality constraints.- Parameters:
f
- the quadratic objective function to be minimizedgreater
- the linear greater-than-or-equal-to constraintsless
- the linear less-than-or-equal-to constraints
-
QPProblem
public QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater)
Construct a quadratic programming problem with linear equality and greater-than-or-equal-to constraints.- Parameters:
f
- the quadratic objective function to be minimizedequal
- the linear equality constraintsgreater
- the linear greater-than-or-equal-to constraints
-
QPProblem
public QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater)
Construct a quadratic programming problem with linear greater-than-or-equal-to constraints.- Parameters:
f
- the quadratic objective function to be minimizedgreater
- the linear greater-than-or-equal-to constraints
-
QPProblem
public QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear equality and less-than-or-equal-to constraints.- Parameters:
f
- the quadratic objective function to be minimizedequal
- the linear equality constraintsless
- the linear less-than-or-equal-to constraints
-
QPProblem
public QPProblem(QuadraticFunction f, LinearLessThanConstraints less)
Construct a quadratic programming problem with linear less-than-or-equal-to constraints.- Parameters:
f
- the quadratic objective function to be minimizedless
- the linear less-than-or-equal-to constraints
-
QPProblem
public QPProblem(QPProblem that)
Copy constructor.- Parameters:
that
- an quadratic programming problem
-
-
Method Detail
-
dimension
public int dimension()
Description copied from interface:OptimProblem
Get the number of variables.- Specified by:
dimension
in interfaceOptimProblem
- Returns:
- the number of variables.
-
f
public QuadraticFunction f()
Description copied from interface:OptimProblem
Get the objective function.- Specified by:
f
in interfaceOptimProblem
- Returns:
- the objective function
-
getGreaterThanConstraints
public LinearGreaterThanConstraints getGreaterThanConstraints()
Get the set of linear greater-than-or-equal-to constraints.- Returns:
- the set of linear greater-than-or-equal-to constraints
-
getLessThanConstraints
public LinearLessThanConstraints getLessThanConstraints()
Description copied from interface:ConstrainedOptimProblem
Gets the less-than-or-equal-to constraints, gi(x) ≤ 0- Specified by:
getLessThanConstraints
in interfaceConstrainedOptimProblem
- Returns:
- the less-than-or-equal-to constraints
-
getEqualityConstraints
public LinearEqualityConstraints getEqualityConstraints()
Description copied from interface:ConstrainedOptimProblem
Gets the equality constraints, hi(x) = 0- Specified by:
getEqualityConstraints
in interfaceConstrainedOptimProblem
- Returns:
- the equality constraints
-
A
public ImmutableMatrix A()
Get the coefficients of the inequality constraints: A as in \(Ax \geq b\).- Returns:
- the inequality constraint coefficients
-
b
public ImmutableVector b()
Get the values of the inequality constraints: b as in \(Ax \geq b\).- Returns:
- the inequality constraint values
-
Aeq
public ImmutableMatrix Aeq()
Get the coefficients of the equality constraints: Aeq as in \(A_{eq}x = b_{eq}\).- Returns:
- the equality constraint coefficients
-
beq
public ImmutableVector beq()
Get the values of the equality constraints: beq as in \(A_{eq}x = b_{eq}\).- Returns:
- the equality constraint values
-
-