This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: ref
- To: Varghese John <vjohn111 at hotmail dot com>
- Subject: Re: ref
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Wed, 26 Sep 2001 21:25:42 +0100 (BST)
- CC: gsl-discuss at sources dot redhat dot com
- References: <F47a7kCurcYNnf6ycBr000086a2@hotmail.com><3BB22690.D6794FA1@lanl.gov>
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