diff options
author | jaimefrio <jaime.frio@gmail.com> | 2014-02-11 22:41:42 -0800 |
---|---|---|
committer | jaimefrio <jaime.frio@gmail.com> | 2014-02-11 22:42:07 -0800 |
commit | 9dcdb57792d9b03144b55ebe84bc97b32af6c1db (patch) | |
tree | 7bcf10645fb7fc65de282d8edbade449f9232755 /numpy/polynomial/polyutils.py | |
parent | 688b243552cc98d8e1be791eeda3fba81bfbe807 (diff) | |
download | numpy-9dcdb57792d9b03144b55ebe84bc97b32af6c1db.tar.gz |
ENH: single pass over array in `bincount` to determine output size
`bincount` checks its input array to make sure there are no negative entries,
and to determine the size of the output array. This is done by calling two
different functions, each having to loop over the whole array. This PR
adds a new function, `minmax`, that computes the minimum and maximum of the
array in a single pass over it. This leads to speed-ups peaking at 1.5x,
with typical values for large arrays around 1.15x - 1.25x.
A full benchmark summary of the new implementation, including a supposedly
more efficient algorithm that turned out to run slower, can be found [here](https://gist.github.com/jaimefrio/8743836).
Diffstat (limited to 'numpy/polynomial/polyutils.py')
0 files changed, 0 insertions, 0 deletions