27 from qpoases
import PyQProblemB
as QProblemB
28 from qpoases
import PyBooleanType
as BooleanType
29 from qpoases
import PySubjectToStatus
as SubjectToStatus
30 from qpoases
import PyOptions
as Options
36 H = np.array([1.0, 0.0, 0.0, 0.5 ]).reshape((2,2))
37 g = np.array([1.5, 1.0 ])
38 lb = np.array([0.5, -2.0])
39 ub = np.array([5.0, 2.0 ])
43 g_new = np.array([1.0, 1.5])
44 lb_new = np.array([0.0, -1.0])
45 ub_new = np.array([5.0, -0.5])
52 options.enableFlippingBounds = BooleanType.FALSE
53 options.initialStatusBounds = SubjectToStatus.INACTIVE
54 options.numRefinementSteps = 1
56 example.setOptions(options)
60 example.init(H, g, lb, ub, nWSR)
61 print(
"\nnWSR = %d\n\n"%nWSR)
65 example.hotstart(g_new, lb_new, ub_new, nWSR)
66 print(
"\nnWSR = %d\n\n"% nWSR)
70 example.getPrimalSolution(xOpt)
71 print(
"\nxOpt = [ %e, %e ]; objVal = %e\n\n" %(xOpt[0], xOpt[1],
Implements the online active set strategy for box-constrained QPs.
Provides a generic way to set and pass user-specified options.
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int n)