Skip to content

Commit

Permalink
Upgrade eigen to 3.4.0 (#186)
Browse files Browse the repository at this point in the history
* upgrade eigen to 3.4.0

* fix tests failures due to eigen upgrade

* minor fix

* revert zonotope test_values

* change zonotope expected value

* final fix
  • Loading branch information
vaithak authored Oct 11, 2021
1 parent 536264d commit af5e2a0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions examples/Eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -27,4 +27,4 @@ function(GetEigen)

include_directories(${EIGEN_DIR})

endfunction()
endfunction()
4 changes: 2 additions & 2 deletions test/Eigen.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -27,4 +27,4 @@ function(GetEigen)

include_directories(${EIGEN_DIR})

endfunction()
endfunction()
2 changes: 1 addition & 1 deletion test/new_rounding_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void call_test_skinny_cubes() {
P = generate_skinny_cube<Hpolytope>(20);
rounding_test(P, 0,
8.26497 * std::pow(10,7),
8.94948e+07,
8.28811e+07,
1.09218e+08,
104857600.0);
}
Expand Down
2 changes: 1 addition & 1 deletion test/volume_cb_hpolytope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
13 changes: 7 additions & 6 deletions test/volume_cb_zonotopes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 <class Polytope>
Expand Down Expand Up @@ -137,15 +138,15 @@ void call_test_uniform_generator(){
exact_vol = exact_zonotope_vol<NT>(P);
test_volume_hpoly(P,
0,
5.7603e+20,
6.95342e+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,
3.98317 * std::pow(10,20),
5.72727 * std::pow(10,20),
7.12503 * std::pow(10,20),
3.42945 * std::pow(10,20),
4.68065 * std::pow(10,20),
6.45698 * std::pow(10,20),
exact_vol);
}

Expand Down

0 comments on commit af5e2a0

Please sign in to comment.