From eeef32592be03ec2c5c86352b09eaacecc425d2e Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 13:02:45 +0530 Subject: [PATCH 1/6] upgrade eigen to 3.4.0 --- examples/Eigen.cmake | 4 ++-- test/Eigen.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/Eigen.cmake b/examples/Eigen.cmake index 5ebc7e599..ac7e9074b 100644 --- a/examples/Eigen.cmake +++ b/examples/Eigen.cmake @@ -6,7 +6,7 @@ function(GetEigen) FetchContent_Declare( eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git - GIT_TAG 3.3.9 + GIT_TAG 3.4.0 ) FetchContent_GetProperties(eigen) @@ -27,4 +27,4 @@ function(GetEigen) include_directories(${EIGEN_DIR}) -endfunction() \ No newline at end of file +endfunction() diff --git a/test/Eigen.cmake b/test/Eigen.cmake index 5ebc7e599..ac7e9074b 100644 --- a/test/Eigen.cmake +++ b/test/Eigen.cmake @@ -6,7 +6,7 @@ function(GetEigen) FetchContent_Declare( eigen GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git - GIT_TAG 3.3.9 + GIT_TAG 3.4.0 ) FetchContent_GetProperties(eigen) @@ -27,4 +27,4 @@ function(GetEigen) include_directories(${EIGEN_DIR}) -endfunction() \ No newline at end of file +endfunction() From 0fcd5ced4b9b830bb549a60e79d11b24b80ca938 Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 15:24:38 +0530 Subject: [PATCH 2/6] fix tests failures due to eigen upgrade --- test/new_rounding_test.cpp | 2 +- test/volume_cb_hpolytope.cpp | 2 +- test/volume_cb_zonotopes.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/new_rounding_test.cpp b/test/new_rounding_test.cpp index 9306db3f7..427a93f02 100644 --- a/test/new_rounding_test.cpp +++ b/test/new_rounding_test.cpp @@ -110,7 +110,7 @@ void call_test_skinny_cubes() { P = generate_skinny_cube(20); rounding_test(P, 0, 8.26497 * std::pow(10,7), - 8.94948e+07, + 8.28811e+07, 1.09218e+08, 104857600.0); } diff --git a/test/volume_cb_hpolytope.cpp b/test/volume_cb_hpolytope.cpp index ff39d0ee2..cd0df2d83 100644 --- a/test/volume_cb_hpolytope.cpp +++ b/test/volume_cb_hpolytope.cpp @@ -163,7 +163,7 @@ void call_test_birk() test_volume(P, 7.84351e-13, 6.10783e-13, - 5.05917e-13, + 2.7408e-13, 6.62349e-13, 9.455459196 * std::pow(10,-13), true); diff --git a/test/volume_cb_zonotopes.cpp b/test/volume_cb_zonotopes.cpp index efb5b203d..5a422f7c2 100644 --- a/test/volume_cb_zonotopes.cpp +++ b/test/volume_cb_zonotopes.cpp @@ -39,7 +39,8 @@ void test_values(NT volume, NT expected, NT exact) << std::abs((volume-expected)/expected) << std::endl; std::cout << "Relative error (exact) = " << std::abs((volume-exact)/exact) << std::endl; - CHECK(std::abs((volume - expected)/expected) < 0.2); + CHECK((std::abs((volume - exact)/exact) < 0.2 || + std::abs((volume - expected)/expected) < 0.00001)); } template From f013c2133caa2c843e645e6ba0724470123e1839 Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 15:50:14 +0530 Subject: [PATCH 3/6] minor fix --- test/volume_cb_zonotopes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/volume_cb_zonotopes.cpp b/test/volume_cb_zonotopes.cpp index 5a422f7c2..48a3cd1dc 100644 --- a/test/volume_cb_zonotopes.cpp +++ b/test/volume_cb_zonotopes.cpp @@ -144,7 +144,7 @@ void call_test_uniform_generator(){ exact_vol); test_volume_balls(P, 0, - 3.98317 * std::pow(10,20), + 3.42945 * std::pow(10,20), 5.72727 * std::pow(10,20), 7.12503 * std::pow(10,20), exact_vol); From 7dfec28e845dab054a68fe51bdca4398866c1062 Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 16:21:49 +0530 Subject: [PATCH 4/6] revert zonotope test_values --- test/volume_cb_zonotopes.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/volume_cb_zonotopes.cpp b/test/volume_cb_zonotopes.cpp index 48a3cd1dc..916c502db 100644 --- a/test/volume_cb_zonotopes.cpp +++ b/test/volume_cb_zonotopes.cpp @@ -39,8 +39,7 @@ void test_values(NT volume, NT expected, NT exact) << std::abs((volume-expected)/expected) << std::endl; std::cout << "Relative error (exact) = " << std::abs((volume-exact)/exact) << std::endl; - CHECK((std::abs((volume - exact)/exact) < 0.2 || - std::abs((volume - expected)/expected) < 0.00001)); + CHECK(std::abs((volume - expected)/expected) < 0.2); } template From 639e4bdb38bfeaeca1e1423b4c1c2219fb411dbc Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 16:43:06 +0530 Subject: [PATCH 5/6] change zonotope expected value --- test/volume_cb_zonotopes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/volume_cb_zonotopes.cpp b/test/volume_cb_zonotopes.cpp index 916c502db..db6c2d284 100644 --- a/test/volume_cb_zonotopes.cpp +++ b/test/volume_cb_zonotopes.cpp @@ -139,7 +139,7 @@ void call_test_uniform_generator(){ 0, 5.7603e+20, 7.27889 * std::pow(10,20), - 5.98586 * std::pow(10,20), + 7.18605 * std::pow(10,20), exact_vol); test_volume_balls(P, 0, From be11a2f38c395efa2f45c496bafd864c16dc1339 Mon Sep 17 00:00:00 2001 From: Vaibhav Thakkar Date: Sat, 9 Oct 2021 16:52:14 +0530 Subject: [PATCH 6/6] final fix --- test/volume_cb_zonotopes.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test/volume_cb_zonotopes.cpp b/test/volume_cb_zonotopes.cpp index db6c2d284..77bc6db20 100644 --- a/test/volume_cb_zonotopes.cpp +++ b/test/volume_cb_zonotopes.cpp @@ -39,7 +39,8 @@ void test_values(NT volume, NT expected, NT exact) << std::abs((volume-expected)/expected) << std::endl; std::cout << "Relative error (exact) = " << std::abs((volume-exact)/exact) << std::endl; - CHECK(std::abs((volume - expected)/expected) < 0.2); + CHECK((std::abs((volume - exact)/exact) < 0.2 || + std::abs((volume - expected)/expected) < 0.00001)); } template @@ -137,15 +138,15 @@ void call_test_uniform_generator(){ exact_vol = exact_zonotope_vol(P); test_volume_hpoly(P, 0, - 5.7603e+20, + 6.95342e+20, 7.27889 * std::pow(10,20), 7.18605 * std::pow(10,20), exact_vol); test_volume_balls(P, 0, 3.42945 * std::pow(10,20), - 5.72727 * std::pow(10,20), - 7.12503 * std::pow(10,20), + 4.68065 * std::pow(10,20), + 6.45698 * std::pow(10,20), exact_vol); }