[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] brent minimization
From: |
Brian Gough |
Subject: |
Re: [Help-gsl] brent minimization |
Date: |
Wed, 09 Jan 2008 21:56:21 +0000 |
User-agent: |
Wanderlust/2.14.0 (Africa) Emacs/22.1 Mule/5.0 (SAKAKI) |
At Fri, 4 Jan 2008 16:23:02 -0500,
Andrew W. Steiner wrote:
>
> I probably have a case of the stupids today...but just in case I don't,
> here's a question. There seems to be a whole section of
> unreachable code in brent.c (see below)
> since the first if-else construct always returns, so the next if-else
> construct is never executed. Is this intentional?
>
This is now fixed in CVS, thanks for the bug report!
--
Brian Gough
--- a/min/brent.c
+++ b/min/brent.c
@@ -185,13 +185,11 @@ brent_iterate (void *vstate, gsl_function * f, double
*x_minimum, double * f_min
{
*x_lower = u;
*f_lower = f_u;
- return GSL_SUCCESS;
}
else
{
*x_upper = u;
*f_upper = f_u;
- return GSL_SUCCESS;
}
if (f_u <= f_w || w == z)
@@ -210,7 +208,7 @@ brent_iterate (void *vstate, gsl_function * f, double
*x_minimum, double * f_min
}
}
- return GSL_FAILURE;
+ return GSL_SUCCESS;
}