19 #ifndef __tsid_python_constriant_bound_hpp__
20 #define __tsid_python_constriant_bound_hpp__
30 namespace bp = boost::python;
32 template<
typename Constra
intBound>
34 :
public boost::python::def_visitor< ConstraintPythonVisitor<ConstraintBound> >
36 template<
class PyClass>
41 .def(bp::init<std::string>((bp::arg(
"name")),
"Default constructor with name."))
42 .def(bp::init<std::string, unsigned int>((bp::arg(
"name"), bp::arg(
"size")),
"Default constructor with name and size."))
43 .def(bp::init<std::string, Eigen::VectorXd, Eigen::VectorXd>((bp::arg(
"name"), bp::arg(
"lb"), bp::arg(
"ub")),
"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")),
"Resize constraint size.")
49 .add_property(
"isEquality", &ConstraintBound::isEquality)
50 .add_property(
"isInequality", &ConstraintBound::isInequality)
51 .add_property(
"isBound", &ConstraintBound::isBound)
57 .def(
"setVector", (
bool (ConstraintBound::*)(
const Eigen::VectorXd &)
const) &ConstraintBound::setVector, bp::args(
"vector"),
"Set Vector")
58 .def(
"setLowerBound", (
bool (ConstraintBound::*)(
const Eigen::VectorXd &)
const) &ConstraintBound::setLowerBound, bp::args(
"lb"),
"Set LowerBound")
59 .def(
"setUpperBound", (
bool (ConstraintBound::*)(
const Eigen::VectorXd &)
const) &ConstraintBound::setUpperBound, bp::args(
"ub"),
"Set UpperBound")
62 static Eigen::VectorXd
vector (
const ConstraintBound &
self) {
return self.vector();}
63 static Eigen::VectorXd
lowerBound (
const ConstraintBound &
self) {
return self.lowerBound();}
64 static Eigen::VectorXd
upperBound (
const ConstraintBound &
self) {
return self.upperBound();}
66 static void expose(
const std::string & class_name)
68 std::string doc =
"Constraint Bound info.";
69 bp::class_<ConstraintBound>(class_name.c_str(),
79 #endif // ifndef __tsid_python_constriant_bound_hpp__