18 #ifndef __tsid_python_constriant_equality_hpp__
19 #define __tsid_python_constriant_equality_hpp__
29 template <
typename Constra
intEquality>
31 :
public boost::python::def_visitor<
32 ConstraintEqPythonVisitor<ConstraintEquality> > {
33 template <
class PyClass>
36 cl.def(bp::init<std::string>((bp::arg(
"name")),
37 "Default constructor with name."))
38 .def(bp::init<std::string, unsigned int, unsigned int>(
39 (bp::arg(
"name"), bp::arg(
"row"), bp::arg(
"col")),
40 "Default constructor with name and size."))
41 .def(bp::init<std::string, Eigen::MatrixXd, Eigen::VectorXd>(
42 (bp::arg(
"name"), bp::arg(
"A"), bp::arg(
"b")),
43 "Default constructor with name and constraint."))
45 .add_property(
"rows", &ConstraintEquality::rows)
46 .add_property(
"cols", &ConstraintEquality::cols)
47 .def(
"resize", &ConstraintEquality::resize,
48 (bp::arg(
"r"), bp::arg(
"c")),
"Resize constraint size.")
50 .add_property(
"isEquality", &ConstraintEquality::isEquality)
51 .add_property(
"isInequality", &ConstraintEquality::isInequality)
52 .add_property(
"isBound", &ConstraintEquality::isBound)
60 (
bool (ConstraintEquality::*)(
62 const Eigen::MatrixXd>))&ConstraintEquality::setMatrix,
63 bp::args(
"matrix"),
"Set Matrix")
65 (
bool (ConstraintEquality::*)(
67 const Eigen::VectorXd>))&ConstraintEquality::setVector,
68 bp::args(
"vector"),
"Set Vector")
70 (
bool (ConstraintEquality::*)(
72 const Eigen::VectorXd>))&ConstraintEquality::setLowerBound,
73 bp::args(
"lb"),
"Set LowerBound")
75 (
bool (ConstraintEquality::*)(
77 const Eigen::VectorXd>))&ConstraintEquality::setUpperBound,
78 bp::args(
"ub"),
"Set UpperBound")
82 static Eigen::MatrixXd
matrix(
const ConstraintEquality&
self) {
85 static Eigen::VectorXd
vector(
const ConstraintEquality&
self) {
88 static Eigen::VectorXd
lowerBound(
const ConstraintEquality&
self) {
89 return self.lowerBound();
91 static Eigen::VectorXd
upperBound(
const ConstraintEquality&
self) {
92 return self.upperBound();
95 static void expose(
const std::string& class_name) {
96 std::string doc =
"Constraint Equality info.";
97 bp::class_<ConstraintEquality>(
class_name.c_str(), doc.c_str(), bp::no_init)
100 eigenpy::enableEigenPySpecific<Eigen::MatrixXd>();
106 #endif // ifndef __tsid_python_constriant_equality_hpp__