7#include <eigenpy/deprecation-policy.hpp>
12using context::StageConstraint;
14using PolyFunc = xyz::polymorphic<StageFunction>;
15using PolySet = xyz::polymorphic<ConstraintSet>;
19 return new context::StageConstraint{f, c};
30 bp::class_<StageConstraint>(
32 "A stage-wise constraint, of the form :math:`c(x,u) \\leq 0 c(x,u)`.\n"
33 ":param f: underlying function\n"
34 ":param cs: constraint set",
39 eigenpy::deprecation_warning_policy<>(
40 "This class has been deprecated and will be removed in a "
41 "future version of aligator."),
42 (
"func"_a,
"cstr_set")),
43 "Contruct a StageConstraint from a StageFunction and a constraint "
45 .def_readwrite(
"func", &StageConstraint::func)
46 .def_readwrite(
"set", &StageConstraint::set)
48 "nr", +[](StageConstraint
const &el) {
return el.func->nr; },
49 "Get constraint dimension.");
51 bp::class_<ConstraintStack>(
"ConstraintStack",
"The stack of constraint.",
54 "Get number of individual constraints.")
59 bp::return_internal_reference<>()),
60 "Get the individual dimensions of all constraints.")
62 "Get total dimension of all constraints.");
Defines the constraint object and constraint stack manager for this library.
StageFunctionTpl< Scalar > StageFunction
ConstraintSetTpl< Scalar > ConstraintSet
ConstraintStackTpl< Scalar > ConstraintStack
void exposeConstraint()
Expose constraints.
bp::object get_namespace(const std::string &name)
Create or retrieve a Python scope (that is, a class or module namespace).
void exposeConstraintSets()
xyz::polymorphic< ConstraintSet > PolySet
context::StageConstraint * make_constraint_wrap(const PolyFunc &f, const PolySet &c)
xyz::polymorphic< StageFunction > PolyFunc
const std::vector< long > & dims() const
Get the set of dimensions for each constraint in the stack.
std::vector< PolyFunc > funcs
std::vector< PolySet > sets