{"action":"created","issue":{"url":"https://api.github.com/repos/PSOPT/psopt/issues/5","labels_url":"https://api.github.com/repos/PSOPT/psopt/issues/5/labels{/name}","comments_url":"https://api.github.com/repos/PSOPT/psopt/issues/5/comments","events_url":"https://api.github.com/repos/PSOPT/psopt/issues/5/events","html_url":"https://github.com/PSOPT/psopt/pull/5","id":105052809,"number":5,"title":"Use SNOPT C++ interface.","user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-05T22:16:12Z","updated_at":"2015-09-08T22:46:14Z","closed_at":"2015-09-07T14:30:24Z","pull_request":{"url":"https://api.github.com/repos/PSOPT/psopt/pulls/5","html_url":"https://github.com/PSOPT/psopt/pull/5","diff_url":"https://github.com/PSOPT/psopt/pull/5.diff","patch_url":"https://github.com/PSOPT/psopt/pull/5.patch"},"body":"Hey @vmbecerra. \r\n\r\nI got SNOPT to work using their C++ interface. They distrubute the C++ interface via https://github.com/snopt/snopt-interface, but I copied the files directory into this repo since their license permits it and I don't know if they promise backwards compatibility.\r\n\r\nThere is at least one limitation of what I've done: I've resorted back to using a global pointer for the Workspace. I tried to think of other ways around this but I can't think of a promising solution. The C++ interface still uses a similar function pointer; it doesn't allow you to create a class that defines your problem, like IPOPT does.\r\n\r\nThe snPSOPTusrf does take 3 user workspace parameters...we could try to pass the workspace pointer as part of the int (iu) workspace, though I don't think this is a good idea.\r\n\r\nThe other potential shortcoming is that the code might not deal with automatic derivatives correctly. As written, I think SNOPT is determining sparsity, itself. So even if automatic derivatives are available, it could be the case that numerical derivatives are used (not sure; didn't look too far into this). If this is a problem, we should be able to fix it by rearranging some code (maybe removing the `snprob.computeJac()` call or moving it). \r\n\r\nI tested the SNOPT algorithm on the `twolink` problem and it solved.\r\n\r\nI also wrote a script `install-ubuntu-snopt.sh` that should facilitate building the snopt C++ interface and using SNOPT with PSOPT. A user might need to run that script *before* running `install-ubuntu.sh`, since it modifies the makefiles."},"comment":{"url":"https://api.github.com/repos/PSOPT/psopt/issues/comments/138724519","html_url":"https://github.com/PSOPT/psopt/pull/5#issuecomment-138724519","issue_url":"https://api.github.com/repos/PSOPT/psopt/issues/5","id":138724519,"user":{"login":"chrisdembia","id":846001,"avatar_url":"https://avatars.githubusercontent.com/u/846001?v=3","gravatar_id":"","url":"https://api.github.com/users/chrisdembia","html_url":"https://github.com/chrisdembia","followers_url":"https://api.github.com/users/chrisdembia/followers","following_url":"https://api.github.com/users/chrisdembia/following{/other_user}","gists_url":"https://api.github.com/users/chrisdembia/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisdembia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisdembia/subscriptions","organizations_url":"https://api.github.com/users/chrisdembia/orgs","repos_url":"https://api.github.com/users/chrisdembia/repos","events_url":"https://api.github.com/users/chrisdembia/events{/privacy}","received_events_url":"https://api.github.com/users/chrisdembia/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T22:46:14Z","updated_at":"2015-09-08T22:46:14Z","body":"Thanks for doing that testing. I'm happy it worked. Do you know if those are new issues or if SNOPT had variable success in PSOPT 3?\r\n\r\nI could perhaps to some checking in my version of PSOPT 3 in which I used the new C++ SNOPT interface."}}