bool test_routine(const AccumFloat* dm_known_good, const Float* pnts, unsigned N, unsigned D, Func func, double eps) { AccumFloat* dm = new AccumFloat[N*N]; compute_distance_matrix(func, pnts, N, D, dm); bool ret = is_almost_equal(dm_known_good, dm, N*N, eps); delete[] dm; return ret; }
typename std::enable_if<std::is_floating_point<T>::value && std::is_floating_point<U>::value, bool>::type constexpr is_equal(T left, U right) { return is_almost_equal(left,right); }