diff options
author | cookedm <cookedm@localhost> | 2006-02-21 23:09:12 +0000 |
---|---|---|
committer | cookedm <cookedm@localhost> | 2006-02-21 23:09:12 +0000 |
commit | ede85cec1879d0d18a797749ccf7fc1853a2146e (patch) | |
tree | 450ae37baa762c4357125e428d185aedb8105ac9 /numpy/lib | |
parent | bb23ed753f0548e79bf3371cc7c6a3ec81187bb4 (diff) | |
parent | 0aa85cabe66a188a409e51e04186a050ba6d2d79 (diff) | |
download | numpy-ede85cec1879d0d18a797749ccf7fc1853a2146e.tar.gz |
Merge trunk (r2124:2142) to power optimization branch
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/polynomial.py | 11 | ||||
-rw-r--r-- | numpy/lib/scimath.py | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/numpy/lib/polynomial.py b/numpy/lib/polynomial.py index 0978c6274..5bd393cd5 100644 --- a/numpy/lib/polynomial.py +++ b/numpy/lib/polynomial.py @@ -10,9 +10,9 @@ import re import numpy.core.numeric as NX from numpy.core import isscalar -from twodim_base import diag, vander -from shape_base import hstack, atleast_1d -from function_base import trim_zeros, sort_complex +from numpy.lib.twodim_base import diag, vander +from numpy.lib.shape_base import hstack, atleast_1d +from numpy.lib.function_base import trim_zeros, sort_complex eigvals = None lstsq = None @@ -355,6 +355,9 @@ class poly1d(object): p = poly1d([1,2,3], variable='lambda') will use lambda in the string representation of p. """ + coeffs = None + order = None + variable = None def __init__(self, c_or_r, r=0, variable=None): if isinstance(c_or_r, poly1d): for key in c_or_r.__dict__.keys(): @@ -464,7 +467,7 @@ class poly1d(object): if not isscalar(val) or int(val) != val or val < 0: raise ValueError, "Power to non-negative integers only." res = [1] - for k in range(val): + for _ in range(val): res = polymul(self.coeffs, res) return poly1d(res) diff --git a/numpy/lib/scimath.py b/numpy/lib/scimath.py index 1e06946b6..1875647aa 100644 --- a/numpy/lib/scimath.py +++ b/numpy/lib/scimath.py @@ -27,7 +27,7 @@ def _fix_real_lt_zero(x): x = asarray(x) if any(isreal(x) & (x<0)): x = _tocomplex(x) - return asscalar(x) + return x def _fix_real_abs_gt_1(x): x = asarray(x) |