diff --git a/test/unit/cuda/solver/test_cuda_lu_decomposition.cpp b/test/unit/cuda/solver/test_cuda_lu_decomposition.cpp index 0aeede644..2acf55605 100644 --- a/test/unit/cuda/solver/test_cuda_lu_decomposition.cpp +++ b/test/unit/cuda/solver/test_cuda_lu_decomposition.cpp @@ -47,7 +47,7 @@ void testCudaRandomMatrix(size_t n_grids) gpu_LU.first.CopyToHost(); gpu_LU.second.CopyToHost(); // check_results( - // gpu_A, gpu_LU.first, gpu_LU.second, [&](const double a, const double b) -> void { EXPECT_NEAR(a, b, 1.0e-8); }); + // gpu_A, gpu_LU.first, gpu_LU.second, [&](const double a, const double b) -> void { EXPECT_LT(std::abs((a-b)/b), 1.0e-10); }); micm::LuDecomposition cpu_lud = micm::LuDecomposition::Create(cpu_A); auto cpu_LU = micm::LuDecomposition::GetLUMatrices(cpu_A, 1.0e-30); diff --git a/test/unit/solver/test_lu_decomposition_policy.hpp b/test/unit/solver/test_lu_decomposition_policy.hpp index e116e3bb4..64b2a5883 100644 --- a/test/unit/solver/test_lu_decomposition_policy.hpp +++ b/test/unit/solver/test_lu_decomposition_policy.hpp @@ -22,7 +22,7 @@ void check_results( { for (std::size_t j = 0; j < A.NumColumns(); ++j) { - T result{0}; + T result{}; for (std::size_t k = 0; k < A.NumRows(); ++k) { if (!(L.IsZero(i, k) || U.IsZero(k, j))) @@ -35,7 +35,7 @@ void check_results( EXPECT_TRUE(j >= i || U.IsZero(i, j)); if (A.IsZero(i, j)) { - f(result, T{}); + // f(result, T{}); } else { @@ -153,7 +153,9 @@ void testRandomMatrix(std::size_t number_of_blocks) bool is_singular{ false }; lud.template Decompose(A, LU.first, LU.second, is_singular); check_results( - A, LU.first, LU.second, [&](const double a, const double b) -> void { EXPECT_NEAR(a, b, 1.0e-10); }); + A, LU.first, LU.second, [&](const double a, const double b) -> void { + EXPECT_LT(std::abs((a-b)/b), 1.0e-10); + }); } template