4#include <eigenpy/std-array.hpp>
10using context::VectorXs;
11using lqr_t = LQRProblemTpl<context::Scalar>;
16 auto &[xs, us, vs, lbdas] = ss;
25 const Scalar mueq,
bool update) {
26 Eigen::SparseMatrix<Scalar> mat;
30 return bp::make_tuple(mat, rhs);
37 +[](
const lqr_t &problem, Scalar mudyn, Scalar mueq) {
39 return bp::make_tuple(std::get<0>(mat_rhs), std::get<1>(mat_rhs));
41 (
"problem"_a,
"mudyn",
"mueq"));
44 (
"problem"_a,
"mudyn",
"mueq",
"update"),
45 "Create or update a sparse matrix from an LQRProblem.");
50 (
"problem"_a,
"xs",
"us",
"vs",
"lbdas",
"mudyn",
"mueq",
"theta",
52 "Compute the KKT residual of the LQR problem.");
auto lqrInitializeSolution(const LQRProblemTpl< Scalar > &problem)
bool lqrDenseMatrix(const LQRProblemTpl< Scalar > &problem, Scalar mudyn, Scalar mueq, typename math_types< Scalar >::MatrixXs &mat, typename math_types< Scalar >::VectorXs &rhs)
Fill in a KKT constraint matrix and vector for the given LQ problem with the given dual-regularizatio...
void lqrCreateSparseMatrix(const LQRProblemTpl< Scalar > &problem, const Scalar mudyn, const Scalar mueq, Eigen::SparseMatrix< Scalar > &mat, Eigen::Matrix< Scalar, -1, 1 > &rhs, bool update)
std::array< Scalar, 3 > lqrComputeKktError(const LQRProblemTpl< Scalar > &problem, boost::span< const typename math_types< Scalar >::VectorXs > xs, boost::span< const typename math_types< Scalar >::VectorXs > us, boost::span< const typename math_types< Scalar >::VectorXs > vs, boost::span< const typename math_types< Scalar >::VectorXs > lbdas, const Scalar mudyn, const Scalar mueq, const std::optional< typename math_types< Scalar >::ConstVectorRef > &theta_, bool verbose=false)
bp::dict lqr_sol_initialize_wrap(const lqr_t &problem)
LQRProblemTpl< context::Scalar > lqr_t
bp::tuple lqr_create_sparse_wrap(const lqr_t &problem, const Scalar mudyn, const Scalar mueq, bool update)