bug correction: in sq_dist, Z was modified when the function is call -> add .copy()
add precomputed kernel case
change the result after the correction of the bug