scipy/scipy — pull request #3702 by richardtsai (2014-06-03 07:19:47+00:00)
Title: BUG: cluster: _vq unable to handle large features

`_vq.vq` should initialize `outdists` to INF but `ndarray.fill` seems to treat `NPY_INFINITY` as an int32 and initialize outdists to `2 ^ 31 - 1`, so that the result may be wrong when the features are large. Use `np.inf` to fill `outdists` would be safer.

`ndarray.fill(np.inf)` will fail with numpy 1.5 (only in Cython, no idea why), but `np.PyArray_FillWithScalar` will not. So use the latter instead.