public class QPProblem extends Object implements ConstrainedOptimProblem
QuadraticFunction(H,p) means
\(\tfrac12 x^{\mathsf T}Hx+p^{\mathsf T}x\): include the factor of two in H
when translating a sum of squared terms. Each constraint matrix row is one
constraint, every row has one column per decision variable, and its right-hand
side vector has one entry per row. Equality, greater-than, and less-than
arguments are distinct; do not change the inequality direction without also
negating both the matrix and right-hand side.
A problem object does not optimize itself. Pass it to a QP minimizer, then call the returned solution's search method. A missing constraint family may be represented by null where the constructor permits it. Convex-solver examples assume a symmetric positive-definite Hessian and a nonempty feasible set.
| Constructor and Description |
|---|
QPProblem(QPProblem that)
Copy constructor.
|
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.
|
| Modifier and Type | Method and 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: \(A_{eq}\) 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: \(b_{eq}\) 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, \(h_{i}(x) = 0\)
|
LinearGreaterThanConstraints |
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
|
public QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
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 constraintspublic QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater, LinearLessThanConstraints less)
f - the quadratic objective function to be minimizedgreater - the linear greater-than-or-equal-to constraintsless - the linear less-than-or-equal-to constraintspublic QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearGreaterThanConstraints greater)
f - the quadratic objective function to be minimizedequal - the linear equality constraintsgreater - the linear greater-than-or-equal-to constraintspublic QPProblem(QuadraticFunction f, LinearGreaterThanConstraints greater)
f - the quadratic objective function to be minimizedgreater - the linear greater-than-or-equal-to constraintspublic QPProblem(QuadraticFunction f, LinearEqualityConstraints equal, LinearLessThanConstraints less)
f - the quadratic objective function to be minimizedequal - the linear equality constraintsless - the linear less-than-or-equal-to constraintspublic QPProblem(QuadraticFunction f, LinearLessThanConstraints less)
f - the quadratic objective function to be minimizedless - the linear less-than-or-equal-to constraintspublic QPProblem(QPProblem that)
that - an quadratic programming problempublic int dimension()
OptimProblemdimension in interface OptimProblempublic QuadraticFunction f()
OptimProblemf in interface OptimProblempublic LinearGreaterThanConstraints getGreaterThanConstraints()
public LinearLessThanConstraints getLessThanConstraints()
ConstrainedOptimProblemgetLessThanConstraints in interface ConstrainedOptimProblempublic LinearEqualityConstraints getEqualityConstraints()
ConstrainedOptimProblemgetEqualityConstraints in interface ConstrainedOptimProblempublic ImmutableMatrix A()
public ImmutableVector b()
public ImmutableMatrix Aeq()
public ImmutableVector beq()
Copyright © 2010-2026 NM Group. All Rights Reserved.