ENH function to return nnz per row/column in some sparse matrices
ENH: added C sqeuclidean_distance, pdist_sqeuclidean and cdist_sqeuclidean
ENH: added wrappers for cdist_sqeuclidean and pdist_sqeuclidean
ENH: pdist and cdist now call faster C functions for sqeuclidean metric
Merge pull request #3252 from emanuele/fast_sqeuclidean

ENH: spatial: Fast sqeuclidean

Current scipy.spatial.distance.cdist() and scipy.spatial.distance.pdist() have a very slow implementation for metric='sqeuclidean'. The current scipy implementation consists of computing the distances with metric='euclidean' (which involves sqrt()) and then - literally - "**2". Since both sqrt() and **2 are useless for 'sqeuclidean' and expensive, this PR means to enhance the speed of computation by avoiding useless computations. This PR adds low-level C functions for 'sqeuclidean' computation, adds the wrappers and the necessary Python code to call them from pdist() and cdist(). Note that there is no change in the API or in the docs. The improved cdist() and pdist() of this PR - when metric='sqeuclidean' - are at least 2x faster than current scipy's ones.
Merge pull request #3247 from jnothman/nnz_axis

ENH: sparse: function to return nnz per row/column in some sparse matrices