HQPOutput.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_HQPOutput_hpp__
19
#define __tsid_python_HQPOutput_hpp__
20
21
#include "
tsid/bindings/python/fwd.hpp
"
22
23
#include "
tsid/solvers/solver-HQP-output.hpp
"
24
25
namespace
tsid
26
{
27
namespace
python
28
{
29
namespace
bp = boost::python;
30
31
template
<
typename
T>
32
struct
HQPOutputPythonVisitor
33
:
public
boost::python::def_visitor< HQPOutputPythonVisitor<T> >
34
{
35
template
<
class
PyClass>
36
37
void
visit
(PyClass& cl)
const
38
{
39
cl
40
.def(bp::init<>(
"Defulat Constructor"
))
41
.def(bp::init<int, int, int>((bp::args(
"nVars"
,
"nEq"
,
"nInCon"
))))
42
.add_property(
"x"
, &
HQPOutputPythonVisitor::x
)
43
.add_property(
"status"
, &
HQPOutputPythonVisitor::status
)
44
;
45
}
46
static
Eigen::VectorXd
x
(
const
T &
self
) {
return
self
.x;}
47
static
int
status
(
const
T &
self
) {
return
self
.status;}
48
static
void
expose
(
const
std::string & class_name)
49
{
50
std::string doc =
"HQPOutput info."
;
51
bp::class_<T>(class_name.c_str(),
52
doc.c_str(),
53
bp::no_init)
54
.def(
HQPOutputPythonVisitor<T>
());
55
}
56
};
57
}
58
}
59
60
61
#endif // ifndef __tsid_python_HQPOutput_hpp__
tsid::python::HQPOutputPythonVisitor
Definition:
HQPOutput.hpp:32
tsid::python::HQPOutputPythonVisitor::expose
static void expose(const std::string &class_name)
Definition:
HQPOutput.hpp:48
solver-HQP-output.hpp
tsid::python::HQPOutputPythonVisitor::status
static int status(const T &self)
Definition:
HQPOutput.hpp:47
tsid::python::HQPOutputPythonVisitor::x
static Eigen::VectorXd x(const T &self)
Definition:
HQPOutput.hpp:46
tsid
Definition:
constraint-bound.hpp:26
fwd.hpp
tsid::python::HQPOutputPythonVisitor::visit
void visit(PyClass &cl) const
Definition:
HQPOutput.hpp:37
include
tsid
bindings
python
solvers
HQPOutput.hpp
Generated by
1.8.17