18 #ifndef __tsid_python_solver_osqp_hpp__
19 #define __tsid_python_solver_osqp_hpp__
33 template <
typename Solver>
35 :
public boost::python::def_visitor<SolverOSQPPythonVisitor<Solver> > {
36 template <
class PyClass>
39 cl.def(bp::init<const std::string &>((bp::arg(
"name")),
40 "Default Constructor with name"))
42 bp::args(
"n",
"neq",
"nin"))
43 .add_property(
"ObjVal", &Solver::getObjectiveValue,
"return obj value")
46 bp::args(
"HQPData for Python"))
47 .add_property(
"qpData", &Solver::getQPData,
"return QP Data object")
49 bp::args(
"HQPData for Python"))
50 .def(
"set_maximum_iterations", &Solver::setMaximumIterations)
51 .def(
"set_sigma", &Solver::setSigma)
52 .def(
"set_alpha", &Solver::setAlpha)
53 .def(
"set_rho", &Solver::setRho)
54 .def(
"set_epsilon_absolute", &Solver::setEpsilonAbsolute)
55 .def(
"set_epsilon_relative", &Solver::setEpsilonRelative)
56 .def(
"set_verbose", &Solver::setVerbose);
61 return self.resize(
n,
neq,
nin);
66 output =
self.solve(problemData);
73 output =
self.solve(
data);
80 self.retrieveQPData(
data);
81 return self.getQPData();
84 static void expose(
const std::string &class_name) {
85 std::string doc =
"Solver osqp info.";
86 bp::class_<Solver>(
class_name.c_str(), doc.c_str(), bp::no_init)
94 #endif // ifndef __tsid_python_solver_osqp_hpp__