[SciPy-user] optimize.brent* full_output=1 ?

David M. Cooke cookedm at physics.mcmaster.ca
Thu Jun 15 00:52:50 CDT 2006

On Thu, 15 Jun 2006 01:29:54 +0200
Steve Schmerler <elcorto at gmx.net> wrote:

> Hi
> I found that some docstrings in optimize don't say which additional 
> outputs the user gets if full_output = 1. Especially brentq, brenth, 
> bisect and ridder are called via _zeros.<func> and so I can't see what 
> it's doing.
> docstrings not OK: bisect, brentq, brenth, golden, ridder
> In [43]: scipy.__version__
> Out[43]: ''

I've updated the routines so that full_output is actually sane. With it True,
these routines return (root, r), where r is a RootResults object
(defined in optimize.zeros). r contains all the info you may want as
attributes: r.iterations, r.function_calls, r.converged (True if the routine
converged), and r.flag (more detail for convergence failures).

[Before, they would return root, iterations, function_calls, flag, which isn't
*quite* as bad as the minimization routines, which return a different number
of results depending on the routine!]

> BTW, I have no experience in wrapping C or Fortran and stuff, so what 
> are the .so files (e.g. _zeros.so)?

C extensions. They're exactly like the shared libraries you'd find
in /usr/lib, but Python loads them as requested at runtime.

|David M. Cooke                      http://arbutus.physics.mcmaster.ca/dmc/
|cookedm at physics.mcmaster.ca

More information about the SciPy-user mailing list