scikit-learn/scikit-learn — pull request #483 by dwf (2011-12-19 17:31:03+00:00)
Title: Refactor euclidean_distance, add optional argument for preallocated output array.

This pull request adds

* Several optimized Cython routines for (squared) Euclidean distance, now used in the dense-dense case by `euclidean_distance`.
* An explicit check that `euclidean_distance` is operating on floating point arrays (general consensus in the sprint room is that it doesn't usually make much sense in the integer case and if you really want that, you can cast).
* An optional `out` argument for `euclidean_distance` (only in the dense-dense case; raises an error otherwise).