Skip to content

Commit 3e922e7

Browse files
author
Apostolos Chalkis
committed
improve new unit tests
1 parent c3b8e3c commit 3e922e7

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/test_internal_points.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void call_test_max_ball() {
3232

3333
std::cout << "\n--- Testing Chebychev ball for skinny H-polytope" << std::endl;
3434
bool pre_rounding = true; // round random polytope before applying the skinny transformation
35-
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(4, 180, pre_rounding, 2000.0, 127);
35+
NT max_min_eig_ratio = NT(2000);
36+
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(4, 180, pre_rounding, max_min_eig_ratio, 127);
3637
P.normalize();
3738
std::pair<Point, NT> InnerBall = P.ComputeInnerBall();
3839

@@ -55,7 +56,8 @@ void call_test_max_ball_feasibility() {
5556

5657
std::cout << "\n--- Testing feasibility point for skinny H-polytope" << std::endl;
5758
bool pre_rounding = true; // round random polytope before applying the skinny transformation
58-
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(50, 500, pre_rounding, 2000.0, 127);
59+
NT max_min_eig_ratio = NT(2000);
60+
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(50, 500, pre_rounding, max_min_eig_ratio, 127);
5961
P.normalize();
6062

6163
bool feasibility_only = true; // compute only a feasible point
@@ -79,7 +81,8 @@ void call_test_analytic_center() {
7981

8082
std::cout << "\n--- Testing analytic center for skinny H-polytope" << std::endl;
8183
bool pre_rounding = true; // round random polytope before applying the skinny transformation
82-
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(3, 15, pre_rounding, 100.0, 127);
84+
NT max_min_eig_ratio = NT(100);
85+
P = skinny_random_hpoly<Hpolytope, NT, PolyRNGType>(3, 15, pre_rounding, max_min_eig_ratio, 127);
8386
P.normalize();
8487

8588
auto [analytic_center, converged] = analytic_center_linear_ineq<MT, VT, NT>(P.get_mat(), P.get_vec());
@@ -101,4 +104,4 @@ TEST_CASE("test_feasibility_point") {
101104

102105
TEST_CASE("test_analytic_center") {
103106
call_test_analytic_center<double>();
104-
}
107+
}

0 commit comments

Comments
 (0)