bindings/python/solvers/solver-HQP-eiquadprog.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __tsid_python_solver_quadprog_hpp__
19 #define __tsid_python_solver_quadprog_hpp__
20 
22 
26 #include "tsid/solvers/fwd.hpp"
28 
29 namespace tsid {
30 namespace python {
31 namespace bp = boost::python;
32 
33 template <typename Solver>
35  : public boost::python::def_visitor<SolverHQuadProgPythonVisitor<Solver> > {
36  template <class PyClass>
37 
38  void visit(PyClass &cl) const {
39  cl.def(bp::init<const std::string &>((bp::arg("name")),
40  "Default Constructor with name"))
41 
43  bp::args("n", "neq", "nin"))
44  .add_property("ObjVal", &Solver::getObjectiveValue, "return obj value")
45  .def("solve", &SolverHQuadProgPythonVisitor::solve, bp::args("HQPData"))
47  bp::args("HQPData for Python"))
48  .add_property("qpData", &Solver::getQPData, "return QP Data object")
49  .def("retrieveQPData", &Solver::retrieveQPData, bp::args("HQPData"))
50  .def("retrieveQPData", &SolverHQuadProgPythonVisitor::retrieveQPData,
51  bp::args("HQPData for Python"));
52  }
53 
54  static void resize(Solver &self, unsigned int n, unsigned int neq,
55  unsigned int nin) {
56  self.resize(n, neq, nin);
57  }
59  const solvers::HQPData &problemData) {
60  solvers::HQPOutput output;
61  output = self.solve(problemData);
62  return output;
63  }
65  solvers::HQPOutput output;
67 
68  output = self.solve(data);
69 
70  return output;
71  }
72 
74  HQPDatas &HQPDatas) {
76  self.retrieveQPData(data);
77  return self.getQPData();
78  }
79 
80  static void expose(const std::string &class_name) {
81  std::string doc = "Solver EiQuadProg info.";
82  bp::class_<Solver>(class_name.c_str(), doc.c_str(), bp::no_init)
84  }
85 };
86 } // namespace python
87 } // namespace tsid
88 
89 #endif // ifndef __tsid_python_solver_quadprog_hpp__
boost::python
solver-HQP-eiquadprog-fast.hpp
class_name
str class_name(str s)
tsid::python::SolverHQuadProgPythonVisitor::solver_helper
static solvers::HQPOutput solver_helper(Solver &self, HQPDatas &HQPDatas)
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:64
tsid::solvers::QPDataQuadProgTpl< double >
test_Solvers.neq
int neq
Definition: test_Solvers.py:13
setup.data
data
Definition: setup.in.py:48
tsid::python::SolverHQuadProgPythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:38
solver-HQP-output.hpp
solver-HQP-eiquadprog.hpp
tsid::solvers::HQPOutput
Definition: solver-HQP-output.hpp:29
tsid::python::SolverHQuadProgPythonVisitor::resize
static void resize(Solver &self, unsigned int n, unsigned int neq, unsigned int nin)
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:54
python
Solver
ADMMContactSolverTpl< context::Scalar > Solver
test_Solvers.nin
int nin
Definition: test_Solvers.py:14
tsid::python::SolverHQuadProgPythonVisitor::expose
static void expose(const std::string &class_name)
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:80
tsid::python::SolverHQuadProgPythonVisitor::solve
static solvers::HQPOutput solve(Solver &self, const solvers::HQPData &problemData)
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:58
tsid::python::HQPDatas
Definition: container.hpp:80
tsid::python::HQPDatas::get
HQPData & get()
Definition: container.hpp:116
tsid
Definition: bindings/python/constraint/constraint-bound.cpp:21
cl
cl
container.hpp
fwd.hpp
tsid::solvers::HQPData
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: solvers/fwd.hpp:99
tsid::python::SolverHQuadProgPythonVisitor::retrieveQPData
static solvers::QPDataQuadProg retrieveQPData(Solver &self, HQPDatas &HQPDatas)
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:73
n
Vec3f n
tsid::python::SolverHQuadProgPythonVisitor
Definition: bindings/python/solvers/solver-HQP-eiquadprog.hpp:34
fwd.hpp


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Thu Apr 3 2025 02:47:16