nlopt icon indicating copy to clipboard operation
nlopt copied to clipboard

cobyla return value has changed from 2.7

Open rlph50 opened this issue 8 months ago • 2 comments

Hi. I have an "R" package which uses NLOPT through the package "nloptR" which basically "wraps" NLOPT. I have been working with the maintainer of the "nloptR" package to identify the issue.

There appears to be a change in behaviour between version 2.7 and 2.10.

Ideally I would like a change to NLOPT which would restore the original functionality.

The example I have used to return numbers not far from the inputs but in 2.10 returns NaN values.

Unfortunately, these issues do not allow me to attach the R files necessary to reproduce the problem but I am happy to email them if there is an appropriate address for this.

Is it possible that this was changed during the resolution of issue #57?

The situation happens after the following message is returned by NLOPT: "NLOPT_ROUNDOFF_LIMITED: Roundoff errors led to a breakdown of the optimization algorithm. In this case, the returned minimum may still be useful. (e.g. this error occurs in NEWUOA if one tries to achieve a tolerance too close to machine precision.)"

It appears that the cobyla algorithm is the only one which will return an NaN in this circumstance.

Note: to reproduce, you will need the current R Windows Develop version (which includes V2.10 of NLOPT): https://cran.r-project.org/bin/windows/base/rdevel.html

rlph50 avatar Mar 15 '25 20:03 rlph50