Closed nbelakovski closed 5 months ago
Hi @nbelakovski ,
I agree with what you said.
I think the solution you propose is fine given the current situation.
However, I am considering another possibility: let the Fortran backend return success
(optional), so that other languages do not need to define success
themselves.
This also motivates a single gateway prima.f90
to the Fortran backend, so that we do not need to define success
for each solver. You proposed this before, and I disagreed, but I now think it is a good idea. Once prima.f90
is defined, we will provide prima_c.f90
to replace newuoa_c.f90
etc, disabling the access to individual solvers. It will make the Fortran API more consistent with the current C and Python ones. However, this is still some dispute about this perspective.
What do you think? We can merge the current solution first, but I hope to hear your opinions.
Thanks.
Zaikun
Hi @nbelakovski ,
Do we really need to expose prima_is_success
in the public API? Could we add a success
field to result
, expecting users to get success
by reading this field?
A similar question was asked about prima_get_rc_string
.
Thanks.
Do we really need to expose
prima_is_success
in the public API? Could we add asuccess
field toresult
, expecting users to getsuccess
by reading this field?
I don't think we need to expose either of these in the public API, and I've made the appropriate changes.
Once prima.f90 is defined, we will provide prima_c.f90 to replace newuoa_c.f90 etc, disabling the access to individual solvers.
Of course I think that defining prima_c.f90
would be much more straightforward than our current solution of almost identically copying the same file 5 times. I think the package overall is more useful if it automatically determines what algorithm to use given the constraints provided, but it would be nice to have an "advanced mode" where users could explicitly specify the solver.
This is in reference to https://github.com/libprima/prima/issues/195
I made it so that ctol is initialized to the default value that was being used. Another option is to check if options.ctol is NaN within
prima_is_success
, but I know we've discussed before thatisnan
can have issues with certain optimization levels.I'll think about it some more, but I'm not sure what other options there are. With either option above we need to maintain a default value within
prima.c
which is not ideal since that implies two places where default values are stored (prima.c
andconsts.f90
). Would it make sense to have aconsts
folder at the root of the repo, which then contains folders likefortran
,c
,python
, each of which defines const values for each of the languages, so that there's one place where these values are maintained?