33#include " aligator/python/blk-matrix.hpp"
44#include " aligator/gar/lqr-problem.hpp"
55#include " aligator/gar/riccati-base.hpp"
6- #include " aligator/gar/utils.hpp"
76
87#include " aligator/python/utils.hpp"
98#include " aligator/python/visitors.hpp"
@@ -24,17 +23,6 @@ using context::VectorXs;
2423
2524using knot_vec_t = lqr_t ::KnotVector;
2625
27- bp::dict lqr_sol_initialize_wrap (const lqr_t &problem) {
28- bp::dict out;
29- auto ss = lqrInitializeSolution (problem);
30- auto &[xs, us, vs, lbdas] = ss;
31- out[" xs" ] = xs;
32- out[" us" ] = us;
33- out[" vs" ] = vs;
34- out[" lbdas" ] = lbdas;
35- return out;
36- }
37-
3826static void exposeBlockMatrices () {
3927 BlkMatrixPythonVisitor<BlkMatrix<MatrixXs, 2 , 2 >>::expose (" BlockMatrix22" );
4028 BlkMatrixPythonVisitor<BlkMatrix<VectorXs, 4 , 1 >>::expose (" BlockVector4" );
@@ -61,6 +49,8 @@ void exposeParallelSolver();
6149void exposeDenseSolver ();
6250// fwd-declare exposeProxRiccati()
6351void exposeProxRiccati ();
52+ // fwd-declare exposeGarUtils()
53+ void exposeGarUtils ();
6454
6555void exposeGAR () {
6656
@@ -129,19 +119,7 @@ void exposeGAR() {
129119 .def (" forward" , &riccati_base_t ::forward,
130120 (" self" _a, " xs" , " us" , " vs" , " lbdas" , " theta" _a = std::nullopt ));
131121
132- bp::def (
133- " lqrDenseMatrix" ,
134- +[](const lqr_t &problem, Scalar mudyn, Scalar mueq) {
135- auto mat_rhs = lqrDenseMatrix (problem, mudyn, mueq);
136- return bp::make_tuple (std::get<0 >(mat_rhs), std::get<1 >(mat_rhs));
137- },
138- (" problem" _a, " mudyn" , " mueq" ));
139-
140- bp::def (" lqrCreateSparseMatrix" , lqrCreateSparseMatrix<Scalar>,
141- (" problem" _a, " mudyn" , " mueq" , " mat" , " rhs" , " update" ),
142- " Create or update a sparse matrix from an LQRProblem." );
143-
144- bp::def (" lqrInitializeSolution" , lqr_sol_initialize_wrap, (" problem" _a));
122+ exposeGarUtils ();
145123
146124#ifdef ALIGATOR_WITH_CHOLMOD
147125 exposeCholmodSolver ();
0 commit comments