Windows complains that Distance::compare(mat,mat) didn't return a value