Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions dingo/bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,20 @@ void HPolytopeCPP::apply_rounding(int rounding_method, double* new_A, double* ne
// run the rounding method
if (rounding_method == 1) { // max ellipsoid
round_res = inscribed_ellipsoid_rounding<MT, VT, NT>(P, CheBall.first);

} else if (rounding_method == 2) { // isotropization
round_res = svd_rounding<AcceleratedBilliardWalk, MT, VT>(P, CheBall, 1, rng);
} else if (rounding_method == 3) { // min ellipsoid
round_res = min_sampling_covering_ellipsoid_rounding<AcceleratedBilliardWalk, MT, VT>(P,
CheBall,
walk_len,
rng);
round_res = min_sampling_covering_ellipsoid_rounding
<AcceleratedBilliardWalk, MT, VT>(P, CheBall, walk_len, rng);
} else if (rounding_method == 4) { // log barrier
round_res = inscribed_ellipsoid_rounding
<MT, VT, NT, decltype(P), decltype(CheBall.first), 2>(P, CheBall.first);
} else if (rounding_method == 5) { // Vaidya barrier
round_res = inscribed_ellipsoid_rounding
<MT, VT, NT, decltype(P), decltype(CheBall.first), 3>(P, CheBall.first);
} else if (rounding_method == 6) { // volumetric barrier
round_res = inscribed_ellipsoid_rounding
<MT, VT, NT, decltype(P), decltype(CheBall.first), 4>(P, CheBall.first);
} else {
throw std::runtime_error("Unknown rounding method.");
}
Expand Down
6 changes: 6 additions & 0 deletions dingo/volestipy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ cdef class HPolytope:
int_method = 2
elif rounding_method == 'min_ellipsoid':
int_method = 3
elif rounding_method == 'log_barrier':
int_method = 4
elif rounding_method == 'vaidya_barrier':
int_method = 5
elif rounding_method == 'volumetric_barrier':
int_method = 6
else:
raise RuntimeError("Uknown rounding method")

Expand Down
12 changes: 11 additions & 1 deletion tests/rounding.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,18 @@ def test_rounding_min_ellipsoid(self):
def test_rounding_john_position(self):
test_rounding(self, "john_position")

def test_rounding_log_barrier(self):
test_rounding(self, "log_barrier")

def test_rounding_vaidya_barrier(self):
test_rounding(self, "vaidya_barrier")

def test_rounding_volumetric_barrier(self):
test_rounding(self, "volumetric_barrier")

if __name__ == "__main__":
if len(sys.argv) > 1:
set_default_solver(sys.argv[1])
sys.argv.pop(1)
unittest.main()
unittest.main()