On Nov 27, 2011, at 12:24 PM, Yoji Imashuku wrote:y.
In my code(C++), I use try/catch to catch exceptions, and as you say
COBYLA does not print anything.
I debugged the code to determine the reason for the exception and
found
"cobyla: rounding errors are becoming damaging."
In one case, exception occurs after 30 evaluations. So far if I use
another
initial value error does not occur so I don't think my code has a bug.
Using try/catch does not catch memory-overrun bugs or writing to
invalid pointers.
If you look at the code that prints that statement in cobyla.c, it is:
if (*iprint >= 1) {
fprintf(stderr, "cobyla: rounding errors are becoming damaging.
\n");
}
But if you look further at the code, you will see that *iprint is
initialized to 0 (COBYLA_MSG_NONE) when cobyla(...) is called and that
*iprint is never changed. Therefore, what you describe cannot occur
unless there was a memory-overrun bug (or a compiler bug, but that is
less likely).
Memory-overrun errors can be unpredictable (google "heisenbug").
Furthermore, it does not surprise me that the particular combination
of events required to produce that particular error message depends on
the initial conditions as well as on the existence of a bug.
Google "valgrind". It is an excellent free tool that runs your code
under a simulator that catches all memory bugs of this sort.
--SGJ
_______________________________________________
NLopt-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/nlopt-discuss