[SciPy-User] Brentq

Joon Ro joonpyro at gmail.com
Thu Jul 26 23:02:47 EDT 2012


On Thu 26 Jul 2012 10:00:33 PM CDT, John Hassler wrote:
>
> On 7/26/2012 10:33 PM, The Helmbolds wrote:
>> The user guide says the algorithm for brentq should be obvious from
>> inspecting the code.
>> Unfortunately, I can't find the code.
>> The entire code in the definition of the brentq function (located in
>> the zeros section of scipy.optimize) reads:
>>     if type(args) != type(()) :
>>     args = (args,)
>> r = _zeros._brentq(f,a,b,xtol,maxiter,args,full_output,disp)
>>
>> So it just calls _zeros._brentq.
>> The module in which the brentq function is defined imports _zeros.
>> I searched but the only _zeros file I could find in scipy.optimize is
>> a _zeros.pyd file,
>> and that's a DLL file, not a Python code object.
>> So I'm at a loss as to where the brentq code is located.

It seems the c source code is here:

https://github.com/scipy/scipy/blob/master/scipy/optimize/Zeros/brentq.c

-Joon



More information about the SciPy-User mailing list