[Numpy-discussion] idea of optimisation?
xabart at gmail.com
Tue Dec 6 07:24:40 EST 2011
Yes I understood what you said. I know these tools, and I am using them.
I was just wandering if someone has a more one-liner-pythonic way to do it.
I don't think it's worth importing a new fortran module.
Thanks anyway :)
2011/12/6 David Froger <david.froger at gmail.com>
> Excerpts from Xavier Barthelemy's message of mar. déc. 06 08:51:22 +0100
> > ok let me be more precise
> > I have an Z array which is the elevation
> > from this I extract a discrete array of Zero Crossing, and another
> > array of Crests.
> > len(crest) is different than len(Xzeros). I have a threshold method to
> > detect my "valid" crests, and sometimes there are 2 crests between two
> > zero-crossing (grouping effect)
> > Crest and Zeros are 2 different arrays, with positions. example:
> > Zeros=[1,2,3,4] Arrays=[1.5,1.7,3.5]
> Thanks for the precision. My suggestion was to consider the
> alternative of
> rewriting the critical time consuming part of the code (the function
> that take
> XCrest and Xzeros as input and return CrestZerosNeighbour) in C or
> Fortran, this
> function si then wrapped into Python using Swig, or F2py, or Cython, or
> I think this is a typical case where this is usefull. Advantage is that
> in the
> C or Fortran function, you can code directly the algorithm you want and
> have an
> maximal optimization. Drawback is that you loose the simplicity of pure
> you need to manage 2 languages and a tool to connect them...
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
« Quand le gouvernement viole les droits du peuple, l'insurrection est,
pour le peuple et pour chaque portion du peuple, le plus sacré des droits
et le plus indispensable des devoirs »
Déclaration des droits de l'homme et du citoyen, article 35, 1793
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion