28 const std::vector<VectorXs> &lams,
29 const std::vector<VectorXs> &vs,
30 std::vector<VectorXs> &Lxs,
31 std::vector<VectorXs> &Lus) {
38 const std::size_t nsteps = problem.
numSteps();
40 ALIGATOR_TRACY_ZONE_SCOPED_N(
"LagrangianDerivatives::compute");
47 const StageFunctionData &init_cond = *pd.
init_data;
48 Lxs[0].noalias() = init_cond.Jx_.transpose() * lams[0];
50 for (std::size_t i = 0; i < nsteps; i++) {
51 const StageModel &sm = *problem.
stages_[i];
53 const ConstraintStack &stack = sm.constraints_;
54 const DynamicsData &dd = *sd.dynamics_data;
56 sd.cost_data->Lx_ + dd.Jx_.transpose() * lams[i + 1];
58 sd.cost_data->Lu_ + dd.Ju_.transpose() * lams[i + 1];
60 BlkView v_(vs[i], stack.dims());
61 for (std::size_t j = 0; j < stack.size(); j++) {
62 const StageFunctionData &cd = *sd.constraint_data[j];
63 Lxs[i].noalias() += cd.Jx_.transpose() * v_[j];
64 Lus[i].noalias() += cd.Ju_.transpose() * v_[j];
67 Lxs[i + 1].noalias() = dd.Jy_.transpose() * lams[i + 1];
73 Lxs[nsteps] += cdterm.Lx_;
75 BlkView vN(vs[nsteps], stack.dims());
76 for (std::size_t j = 0; j < stack.size(); j++) {
78 Lxs[nsteps].noalias() += cd.Jx_.transpose() * vN[j];
static void compute(const TrajOptProblem &problem, const TrajOptData &pd, const std::vector< VectorXs > &lams, const std::vector< VectorXs > &vs, std::vector< VectorXs > &Lxs, std::vector< VectorXs > &Lus)