GepocUS / Spcies

Suite of Predictive Controllers for Industrial Embedded Systems. A Matlab toolbox for automatic code generation of solvers for MPC controllers.
Apache License 2.0
14 stars 2 forks source link

Eliminate the need for a different function prototype when compiling for Matlab MEX #41

Closed pablokrupa closed 6 months ago

pablokrupa commented 11 months ago

Currently, we detect if the code is being generated for Matlab, in which case we add the compiler flag CONF_MATLAB to indicate that the function should be configured for Matlab MEX.

Among other things, this compiler flag is used to select between two different function prototypes. The reason is simply to simplify the mexFunctio() used to generate the MEX executable. However, there really is no reason to do this. It would be better to have a single prototype and improve the mexFunction() to handle structures correctly.

pablokrupa commented 11 months ago

For "LaxMPC" using the "ADMM" solver, this was done in 968639794607e38cb9b5fb4e3b709a6889b6c17a. The same should be done for every other combination of MPC formulation and solver.

pablokrupa commented 11 months ago

mexFunction() for "LaxMPC" using "FISTA" updated in 854fe31e549a7e2f267f965bb9b2b5cedba881bd.

pablokrupa commented 11 months ago

"ADMM" and "FISTA" solvers for "EquMPC" updated as of eb375763dff048b3851348fc42fa01acc0f5b8f0 and 349b89f43e94a3caa600e8ca5a8c43b69635f5b9, respectively.

pablokrupa commented 6 months ago

The CONF_MATLAB flag has been eliminated as of release 'v0.3.10' (bb8406630ea952b0b5ba63e180d0030f91e8390c).