[SciPy-dev] genetic algorithm, number theory, filterdesign,zerofinding

pearu at scipy.org pearu at scipy.org
Thu Apr 11 13:14:18 CDT 2002


On Thu, 11 Apr 2002, Chuck Harris wrote:

> I've taken a look at the 1-D solvers in CVS. A few comments
> 
> 1.	fixed_point computes incorrect roots
> 2.	they make assumptions on the arguments that are not enforced
> 3.	none take into account the varying granularity of floating point
> 4.	newton should probably check for blowup, as this is not uncommon
> 5.	all the python routines suffer from large overheads. We should go for C.
> 
> That said, the routines a pretty quick. I think a good starting point
> would be to take the simplest and put them in C. I expect this would
> at least halve the execution time for easy to compute functions.

How to you feel about Fortran? Actually C is also fine for me.

My point is that we should use f2py to generate the interfaces to these C
(or Fortran, if you have positive feelings about it) routines.
It has an advantage that you don't need to struggle with the
details of Python C/API (reference counting, argument checks, etc.)
All this is supported in f2py generated interfaces. Using f2py saves time
and bugs. And the f2py generated extension modules are really easy to
maintain.

If you are not familiar with f2py then we can cooperate. You give me
a native C function and I'll give you an interface for calling this C
function from Python in no time.

> For newton, I don't think the option of using computed derivatives is
> worth including. There is a slightly higher order of convergence (2 vs
> 1.4), but this is likely to be swamped in function evaluation time,
> especially if the function is python and the routine is C.

Indeed, I have never used  computed derivatives in my real problems. They
are usually to large that calculating exact jacobian, even a bounded one,
is to expensive. But I would like to see how much is there gain or lost of
using exact jacobian in real example.

Pearu





More information about the Scipy-dev mailing list