18 #ifndef __tsid_python_constriant_bound_hpp__
19 #define __tsid_python_constriant_bound_hpp__
29 template <
typename Constra
intBound>
31 :
public boost::python::def_visitor<
32 ConstraintPythonVisitor<ConstraintBound> > {
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>(
39 (bp::arg(
"name"), bp::arg(
"size")),
40 "Default constructor with name and size."))
41 .def(bp::init<std::string, Eigen::VectorXd, Eigen::VectorXd>(
42 (bp::arg(
"name"), bp::arg(
"lb"), bp::arg(
"ub")),
43 "Default constructor with name and constraint."))
45 .add_property(
"rows", &ConstraintBound::rows)
46 .add_property(
"cols", &ConstraintBound::cols)
47 .def(
"resize", &ConstraintBound::resize, (bp::arg(
"r"), bp::arg(
"c")),
48 "Resize constraint size.")
50 .add_property(
"isEquality", &ConstraintBound::isEquality)
51 .add_property(
"isInequality", &ConstraintBound::isInequality)
52 .add_property(
"isBound", &ConstraintBound::isBound)
59 (
bool (ConstraintBound::*)(
61 const Eigen::VectorXd>))&ConstraintBound::setVector,
62 bp::args(
"vector"),
"Set Vector")
64 (
bool (ConstraintBound::*)(
66 const Eigen::VectorXd>))&ConstraintBound::setLowerBound,
67 bp::args(
"lb"),
"Set LowerBound")
69 (
bool (ConstraintBound::*)(
71 const Eigen::VectorXd>))&ConstraintBound::setUpperBound,
72 bp::args(
"ub"),
"Set UpperBound");
74 static Eigen::VectorXd
vector(
const ConstraintBound&
self) {
77 static Eigen::VectorXd
lowerBound(
const ConstraintBound&
self) {
78 return self.lowerBound();
80 static Eigen::VectorXd
upperBound(
const ConstraintBound&
self) {
81 return self.upperBound();
84 static void expose(
const std::string& class_name) {
85 std::string doc =
"Constraint Bound info.";
86 bp::class_<ConstraintBound>(
class_name.c_str(), doc.c_str(), bp::no_init)
93 #endif // ifndef __tsid_python_constriant_bound_hpp__