DAQP.Model
— Typed = DAQP.Model()
creates an empty optimization model d
.
The following functions acts on such models:
DAQP.setup(d,H,f,A,bupper,blower,sense)
: setup a QP problem (seeDAQP.quadprog
for problem details)DAQP.solve(d)
: solve a populated modelDAQP.update(d,H,f,A,bupper,blower,sense)
: update an existing modeldict = DAQP.settings(d)
: return a Dictionary with the current settings for the modeld
DAQP.settings(d,dict)
: update the settings ford
with the Dictionarydict
DAQP.linprog
— Functionxstar, fval, exitflag, info = DAQP.linprog(f,A,bupper)
xstar, fval, exitflag, info = DAQP.linprog(f,A,bupper,blower,sense)
finds the solution xstar
to the linear program
min_x f' x
subject to
blower[1:ms] <= x[1:ms] <= bupper[1:ms]
blower[ms+1:m] <= A*x <= bupper[ms+1:m],
where m = length(bupper)
and ms = m-size(A,2)
.
Input
f
- linear term in objective function, n-vectorA
- constraint normals, ((m-ms) x n
)-matrixbupper
- upper bounds for constraints,m
-vectorblower
- lower bounds for constraints,m
-vector (default: -Inf)sense
- constraint types,m
-vector of Cints (default: 0). Example types:0
: inequality5
: equality
Output
xstar
- solution provided by solverfval
- objective function value forxstar
.exitflag
- flag from solver (>0 success, <0 failure)info
- tuple containing profiling information from the solver.
DAQP.quadprog
— FunctionExample calls
xstar, fval, exitflag, info = DAQP.quadprog(H,f,A,bupper)
xstar, fval, exitflag, info = DAQP.quadprog(H,f,A,bupper,blower,sense)
finds the solution xstar
to the quadratic program
minimize 0.5 x' H x + f' x
subject to blower <= A x <= bupper
If bupper
and blower
have more elements than rows of A
, the first elements are interpreted as simple bounds. For example:
A = [7.0 8.0]
blower = [-4.0; -5.0; -6.0]
bupper = [ 1.0; 2.0; 3.0]
is interpreted as
-4.0 <= x₁ <= 1.0
-5.0 <= x₂ <= 2.0
-6.0 <= 7 x₁ + 8 x₂ <= 3.0
Input
H
- cost matrixf
- cost vectorA
- linear constraint matrixbuppe
- upper bounds for constraintsblower
- lower bounds for constraints (default: -Inf)sense
- constraint types, as a vector of Cints (default: 0). Example types:0
: inequality1
: active inequality (used as warm start)5
: equality8
: soft (allowed to be violated if necessary)16
: binary (either upper or lower bound should hold with equality)
Output
xstar
- solutionfval
- objective function value forxstar
.exitflag
- flag from solver (>0 success, <0 failure)info
- tuple containing profiling information from the solver.