public class DantzigQPSolver
extends java.lang.Object
The solver optionally supports warm starting, controlled by setWarmStartEnabled(boolean), whereby the active set found by one call to solve() is used to seed the next.
| Modifier and Type | Class and Description |
|---|---|
static class |
DantzigQPSolver.Status
Described whether or not a solution was found.
|
| Constructor and Description |
|---|
DantzigQPSolver() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
getWarmStartEnabled()
Queries whether warm starts are enabled.
|
void |
setWarmStartEnabled(boolean enable)
Enables or disables warm starts.
|
DantzigQPSolver.Status |
solve(VectorNd x,
MatrixNd H,
VectorNd f,
MatrixNd A,
VectorNd b)
Solves a convex quadratic program with inequality constraints:
|
DantzigQPSolver.Status |
solve(VectorNd x,
MatrixNd H,
VectorNd f,
MatrixNd A,
VectorNd b,
MatrixNd Aeq,
VectorNd beq)
Solves a convex quadratic program with both equality and inequality
constraints:
|
public boolean getWarmStartEnabled()
setWarmStartEnabled(boolean).true if warm starts are enabledpublic void setWarmStartEnabled(boolean enable)
solve()
methods and used to seed the following solve. Warm starts are disabled by
default.
Warm starting does not change the solution when the program has a
unique minimum. It affects only which minimizer is returned when the
minimum is not unique, and reduces the number of pivots required
for sequences of problems which vary slowly from one solve to the next.
The retained state is discarded whenever the number of inequality
constraints changes, or whenever a solve returns a status other than
DantzigQPSolver.Status.SOLVED.
enable - if true, enables warm startspublic DantzigQPSolver.Status solve(VectorNd x, MatrixNd H, VectorNd f, MatrixNd A, VectorNd b)
min 1/2 x^T H x + f^T x, A x >= b
using Dantzig's LCP pivoting algorithm.x - computed minimum valueH - quadratic matrix term. Must be symmetric positive definitef - linear termA - inequality constraint matrixb - inequality constraint offsetspublic DantzigQPSolver.Status solve(VectorNd x, MatrixNd H, VectorNd f, MatrixNd A, VectorNd b, MatrixNd Aeq, VectorNd beq)
min 1/2 x^T H x + f^T x, A x >= b, Aeq x = beq
using Dantzig's LCP pivoting algorithm.
If there are no inequality constraints, then A should either
have a row size of 0 or be specified as null.
Note that the number of inequality constraints (i.e., the row size of Aeq) should not exceed the size of H. Also, if the row size of Aeq equals the size of H, then only the equalites are solved for and the rest of the problem is ignored.
x - computed minimum valueH - quadratic matrix term. Must be symmetric positive definitef - linear termA - inequality constraint matrix (can be null)b - inequality constraint offsets (can be null if A is null)Aeq - equality constraint matrixbeq - equality constraint offsets