bindings/python/algorithm/contact-solver-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2022-2024 INRIA
3 //
4 
7 
9 
10 namespace pinocchio
11 {
12  namespace python
13  {
14 
15  namespace bp = boost::python;
16 
17  template<typename Solver>
19  : public boost::python::def_visitor<ContactSolverBasePythonVisitor<Solver>>
20  {
21  typedef typename Solver::Scalar Scalar;
22 
23  public:
24  template<class PyClass>
25  void visit(PyClass & cl) const
26  {
27 #ifdef PINOCCHIO_PYTHON_PLAIN_SCALAR_TYPE
28  cl.def(
29  "getIterationCount", &Solver::getIterationCount, bp::arg("self"),
30  "Get the number of iterations achieved by the PGS algorithm.")
31  .def(
32  "setMaxIterations", &Solver::setMaxIterations, bp::args("self", "max_it"),
33  "Set the maximum number of iterations.")
34  .def(
35  "getMaxIterations", &Solver::getMaxIterations, bp::arg("self"),
36  "Get the maximum number of iterations allowed.")
37 
38  .def(
39  "setAbsolutePrecision", &Solver::setAbsolutePrecision,
40  bp::args("self", "absolute_precision"), "Set the absolute precision for the problem.")
41  .def(
42  "getAbsolutePrecision", &Solver::getAbsolutePrecision, bp::arg("self"),
43  "Get the absolute precision requested.")
44 
45  .def(
46  "setRelativePrecision", &Solver::setRelativePrecision,
47  bp::args("self", "relative_precision"), "Set the relative precision for the problem.")
48  .def(
49  "getRelativePrecision", &Solver::getRelativePrecision, bp::arg("self"),
50  "Get the relative precision requested.")
51 
52  .def(
53  "getAbsoluteConvergenceResidual", &Solver::getAbsoluteConvergenceResidual,
54  bp::arg("self"),
55  "Returns the value of the absolute residual value corresponding to the contact "
56  "complementary conditions.")
57  .def(
58  "getRelativeConvergenceResidual", &Solver::getRelativeConvergenceResidual,
59  bp::arg("self"),
60  "Returns the value of the relative residual value corresponding to the difference "
61  "between two successive iterates (infinity norms).")
62 
63  #ifdef PINOCCHIO_WITH_HPP_FCL
64  .def("getCPUTimes", &Solver::getCPUTimes, bp::arg("self"))
65  #endif // PINOCCHIO_WITH_HPP_FCL
66  ;
67 #endif
68  }
69  }; // struct ContactSolverBasePythonVisitor
70 
71  } // namespace python
72 } // namespace pinocchio
pinocchio::python::ContactSolverBasePythonVisitor
Definition: bindings/python/algorithm/contact-solver-base.hpp:18
boost::python
eigen-from-python.hpp
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
contact-solver-base.hpp
python
pinocchio::python::ContactSolverBasePythonVisitor::visit
void visit(PyClass &cl) const
Definition: bindings/python/algorithm/contact-solver-base.hpp:25
cl
cl
fwd.hpp
pinocchio::python::ContactSolverBasePythonVisitor::Scalar
Solver::Scalar Scalar
Definition: bindings/python/algorithm/contact-solver-base.hpp:21
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:08