summaryrefslogtreecommitdiff
path: root/numpy/testing/utils.py
diff options
context:
space:
mode:
authorjaimefrio <jaime.frio@gmail.com>2014-03-25 09:25:27 -0700
committerjaimefrio <jaime.frio@gmail.com>2014-03-25 09:56:59 -0700
commita80946d77e6b488189024d14667d3fe191bdb2f8 (patch)
tree44d03978177d6d1dc6830f5949b9a3e0e0130e5c /numpy/testing/utils.py
parentb80ef7539cc91f4c78a80f425b0906f497fc1f12 (diff)
downloadnumpy-a80946d77e6b488189024d14667d3fe191bdb2f8.tar.gz
ENH: speed-up of triangular matrix functions
* `np.tri` now produces less intermediate arrays. Runs about 40% faster for general dtypes, up to 3x faster for boolean arrays. * `np.tril` now does smarter type conversions (thanks Julian!), and together with the improvements in `np.tri` now runs about 30% faster. `np.triu` runs almost 2x faster than before, but still runs 20% slower than `np.tril`, which is an improvement over the 50% difference before. * `np.triu_indices` and `np.tril_indices` do not call `np.mask_indices`, instead they call `np.where` directly on a boolean array created with `np.tri`. They now run roughly 2x faster. * Removed the constraint for the array to be square in calls to `np.triu_indices`, `np.tril_indices`, `np.triu_indices_from` and `np.tril_indices_from`.
Diffstat (limited to 'numpy/testing/utils.py')
0 files changed, 0 insertions, 0 deletions