snopt / snopt-interface

C/C++ API for SNOPT7
MIT License
27 stars 12 forks source link

snmema character workspace isn't passed up to C interface #15

Closed jefesaurus closed 6 years ago

jefesaurus commented 6 years ago

I'm just working off the trial interface, so I can't see the internals, but is this because snmema never changes the length of the character interface? The fortran docs in e.g. https://ccom.ucsd.edu/~optimizers/static/pdfs/snopt7-6.pdf Still show it as a parameter.

gnowzil commented 6 years ago

Yeah. Not in the C/C++ interface because I never (and still haven't) figured out how to properly handle character array in Fortran and C/C++. See snopt_wrapper.f90 for the subroutines that can be called directly in C/C++. There's a global dummy cw(lencw) with lencw = 500 that gets passed down. As long as lencw is >= 500, snmem will never complain.

jefesaurus commented 6 years ago

okay, thanks for the clarification