osqp / osqp-matlab

Matlab interface for OSQP
https://osqp.org/
Apache License 2.0
42 stars 25 forks source link

Code generation with kkt.c/.h #9

Closed imciner2 closed 5 years ago

imciner2 commented 5 years ago

The code generation routines appear to always (on both vector and matrix updates) copy the kkt.c file into the generated code, instead of ignoring it for the vector updates as the comment suggests should happen. I traced this back to the comparison in osqp.m:468 : ~strcmp(cfiles(i).name, fullfile(cdir, 'kkt.c')) which should actually be: ~strcmp(cfiles(i).name, 'kkt.c') since dir returns only the name of the file, not the full path in that field. Was the use of fullfile() a compatibility fix for older MATLAB versions? I have been doing this recent work on 2019a.

Additionally, kkt.h is still being copied into the generated source when vector updates is requested, even though kkt.c is not. Is this expected behavior? It seems that it should be ignored as well.

If changes are needed, I will make them on my current dev branch in my fork since they tie in with some work I am doing related to the Simulink interface.

gbanjac commented 5 years ago

You are right. This was a bug, not expected behavior. Should be fixed now in master branch.

imciner2 commented 5 years ago

Thanks. I have pulled those changes into my dev branch. What is the oldest version of Matlab that should be tested for compatibility (I want to make sure changes I am making will work)?

goulart-paul commented 5 years ago

Wee ensure backward compatibility to 2015b in the main matlab interface.