Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matlab codegen crash for unscaled problems #7

Closed
goulart-paul opened this issue Apr 29, 2017 · 1 comment
Closed

matlab codegen crash for unscaled problems #7

goulart-paul opened this issue Apr 29, 2017 · 1 comment

Comments

@goulart-paul
Copy link
Collaborator

goulart-paul commented Apr 29, 2017

Matlab crashes when calling osqp.codegen() if user sets

settings.scaling = 0.

The crash occurs in the call to osqp_mex('get_workspace')

Example

%small problem
P = sparse([4., 1.; 1., 2.]);
q = [1; 1];
A = sparse([1., 1; 1, 0; 0, 1]);
l = [1.0; 0.0; 0.0];
u = [1.0; 0.7; 0.7];

%1 = ok, 0 = crash
settings.scaling = 0;

% Solve with osqp and export
solver = osqp;
solver.setup(P, q, A, l, u, settings);
solver.solve();

%crashes here
solver.codegen('export', 'project_type','Xcode','parameters', 'matrices', 'mexname', 'emosqp');
@bstellato
Copy link
Collaborator

When scaling is disabled, the scaling structure is not allocated. The workspace renderer was trying to access the scaling variables even when they did not exist causing the crash in both Python and Matlab.

It is now fixed af59e25

shrenikm-bc pushed a commit to braincorp/osqp that referenced this issue Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants