Hi, I have written a class for polynomials with negative exponents like:
p(x) = a0 + a1*x**-1 + ... + an*x**-n The code is this one: class NegativeExpPolynomial( object ): def __init__ ( self, coeffs ): self.coeffs = np.array( coeffs ) def __call__( self, x ): return sum( (c*x**(-i) for i, c in enumerate( self.coeffs ) ) ) where coeffs = [a0, a1, ..., an]. I find that the way i evaluate the polynomial is kind of *slow*, especially for polynomial with order larger than ~200 and for arrays x large enough. Do you have suggestions on how to speed up this code? Regards, Davide Lasagna -- Phd Student Dipartimento di Ingegneria Aeronautica a Spaziale Politecnico di Torino, Italy tel: 011/0906871 e-mail: davide.lasa...@polito.it; lasagnadav...@gmail.com _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion