"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "scipy/spatial/src/distance_impl.h" between
scipy-1.6.2.tar.xz and scipy-1.6.3.tar.xz

About: SciPy are tools for mathematics, science, and engineering (for Python).

distance_impl.h  (scipy-1.6.2.tar.xz):distance_impl.h  (scipy-1.6.3.tar.xz)
skipping to change at line 224 skipping to change at line 224
npy_intp i; npy_intp i;
npy_intp ntt = 0, nff = 0, nft = 0, ntf = 0; npy_intp ntt = 0, nff = 0, nft = 0, ntf = 0;
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
const npy_bool x = (u[i] != 0), y = (v[i] != 0); const npy_bool x = (u[i] != 0), y = (v[i] != 0);
ntt += x & y; ntt += x & y;
ntf += x & (!y); ntf += x & (!y);
nft += (!x) & y; nft += (!x) & y;
} }
nff = n - ntt - ntf - nft; nff = n - ntt - ntf - nft;
return (2. * ntf * nft) / ((double)ntt * nff + (double)ntf * nft); double half_R = (double)ntf * nft;
if (half_R == 0.0) {
return 0.0;
}
return (2. * half_R) / ((double)ntt * nff + half_R);
} }
static NPY_INLINE double static NPY_INLINE double
dice_distance_char(const char *u, const char *v, const npy_intp n) dice_distance_char(const char *u, const char *v, const npy_intp n)
{ {
npy_intp i; npy_intp i;
npy_intp ntt = 0, ndiff = 0; npy_intp ntt = 0, ndiff = 0;
for (i = 0; i < n; ++i) { for (i = 0; i < n; ++i) {
const npy_bool x = (u[i] != 0), y = (v[i] != 0); const npy_bool x = (u[i] != 0), y = (v[i] != 0);
 End of changes. 1 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)