aligator  0.9.0
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
expose-cost-ops.cpp
Go to the documentation of this file.
1
4
6
7namespace aligator {
8namespace python {
9
12using context::Scalar;
14using PolyCost = xyz::polymorphic<CostAbstract>;
15
17 bp::class_<DirectSumCost, bp::bases<CostAbstract>>("DirectSumCost",
18 bp::no_init)
19 .def(bp::init<xyz::polymorphic<CostAbstract>,
20 xyz::polymorphic<CostAbstract>>(
21 bp::args("self", "cost1", "cost2")))
22 .def_readonly("cost1", &DirectSumCost::c1_)
23 .def_readonly("cost2", &DirectSumCost::c2_)
24 .def(PolymorphicVisitor<PolyCost>());
25
26 bp::class_<DirectSumCost::Data, bp::bases<context::CostData>>(
27 "DirectSumCostData", bp::no_init)
28 .def_readonly("data1", &DirectSumCost::Data::data1_)
29 .def_readonly("data2", &DirectSumCost::Data::data2_);
30
31 bp::def("directSum", directSum<Scalar>, bp::args("cost1", "cost2"),
32 "Perform the direct sum of two cost functions, :math:`l_3(x,u) = "
33 "l_1(x_1,u_1) + l_2(x_2,u_2)`");
34}
35
36} // namespace python
37} // namespace aligator
CostAbstractTpl< Scalar > CostAbstract
Definition context.hpp:25
ManifoldAbstractTpl< Scalar > Manifold
Definition context.hpp:14
xyz::polymorphic< CostAbstract > PolyCost
Main package namespace.
auto directSum(xyz::polymorphic< CostAbstractTpl< Scalar > > const &c1, xyz::polymorphic< CostAbstractTpl< Scalar > > const &c2)
xyz::polymorphic< BaseCost > c1_
xyz::polymorphic< BaseCost > c2_