summaryrefslogtreecommitdiff
path: root/numpy/core/fromnumeric.py
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2012-05-28 14:14:41 -0500
committerMark Wiebe <mwwiebe@gmail.com>2012-05-28 14:14:41 -0500
commit4542c43b567af9064f36759afe6064bbb3315728 (patch)
treed8925acf8e16b1b9f7e77ec6402be1d1d56c3a37 /numpy/core/fromnumeric.py
parentdabe9ab064ae32bfd7cee8c0dc58b175a6955e49 (diff)
downloadnumpy-4542c43b567af9064f36759afe6064bbb3315728.tar.gz
BUG: Add a new flag to nditer to indicate when op uses buffering
Thouis tracked down an intermittently occurring bug in ticket #2144, where a reduction under certain situations would produce wrong results. This occurs when the array data and the nditer's buffer happen to be adjacent in memory. This fixes it by replacing the "clever" trick of checking if the iterator's pointer is in the buffer with an explicit flag to signal buffer usage. The reason this can't be reliably handled via the pointer/buffer check is that the pointer updates are handled by the consumer of the iterator, who may update them in place or may use local variables instead. Thus, the pointer could still point to the beginning of the buffer, or could point at the byte immediately after the buffer. Using a flag avoids all of this and should be reliable.
Diffstat (limited to 'numpy/core/fromnumeric.py')
0 files changed, 0 insertions, 0 deletions