ref
Brian Gough
bjg@network-theory.co.uk
Wed Dec 19 13:20:00 GMT 2001
Gerard Jungman writes:
> Varghese John wrote:
> >
> > Suppose that I am minimising a function and the
> > minimum lies on one of the boundaries, the minimiser throws an "minimum
> > outside interval" error.
> >
> > Can you give me a simple example where I can trap that error
> > (say x*x and interval [-1,0]).
> > so that I can check status and proceed with out crashing.
>
You'll want to turn off the error handler at the start of the program
(or replace it with your own non-exiting error handler) and check the
return value from gsl_min_fminimizer_set().
gsl_set_error_handler_off();
...
status = gsl_min_fminimizer_set (f,....);
if (status != GSL_SUCCESS)
{
/* interval does not bound minimum reliably */
}
regards
Brian Gough
More information about the Gsl-discuss
mailing list