27 from qpoases
import PyQProblem
as QProblem
28 from qpoases
import PyOptions
as Options
29 from qpoases
import PyPrintLevel
as PrintLevel
33 H = np.array([1.0, 0.0, 0.0, 0.5 ]).reshape((2,2))
34 A = np.array([1.0, 1.0 ]).reshape((2,1))
35 g = np.array([1.5, 1.0 ])
36 lb = np.array([0.5, -2.0])
37 ub = np.array([5.0, 2.0 ])
38 lbA = np.array([-1.0 ])
44 g_new = np.array([1.0, 1.5])
45 lb_new = np.array([0.0, -1.0])
46 ub_new = np.array([5.0, -0.5])
47 lbA_new = np.array([-2.0])
48 ubA_new = np.array([1.0])
55 options.printLevel = PrintLevel.NONE
56 example.setOptions(options)
60 example.init(H, g, A, lb, ub, lbA, ubA, nWSR)
66 for i
in range(100000):
67 for j
in range(1, 100):
69 example.hotstart( g_new, lb_new, ub_new, lbA_new, ubA_new, nWSR)
74 example.getPrimalSolution(xOpt)
75 print(
"\nxOpt = [ %e, %e ]; objVal = %e\n\n"%(xOpt[0],xOpt[1],example.getObjVal()))
76 example.printOptions()
Provides a generic way to set and pass user-specified options.
BEGIN_NAMESPACE_QPOASES returnValue print(const real_t *const v, int n)
Implements the online active set strategy for QPs with general constraints.