diff --git a/.gitignore b/.gitignore index 23c482e..d8e930b 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,4 @@ volestipy.egg-info venv lp_solve_5.5/ .devcontainer/ -.github/dependabot.yml \ No newline at end of file +.github/dependabot.yml.venv/ diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..143c2f5 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.8.19 diff --git a/dingo/PolytopeSampler.py b/dingo/PolytopeSampler.py index 27f3785..012355f 100644 --- a/dingo/PolytopeSampler.py +++ b/dingo/PolytopeSampler.py @@ -166,7 +166,7 @@ def generate_steady_states_no_multiphase( """A member function to sample steady states. Keyword arguments: - method -- An MCMC method to sample, i.e. {'billiard_walk', 'cdhr', 'rdhr', 'ball_walk', 'dikin_walk', 'john_walk', 'vaidya_walk', 'gaussian_hmc_walk', 'exponential_hmc_walk', 'hmc_leapfrog_gaussian', 'hmc_leapfrog_exponential'} + method -- An MCMC method to sample, i.e. {'billiard_walk', 'cdhr', 'rdhr', 'ball_walk', 'dikin_walk', 'john_walk', 'vaidya_walk', 'gaussian_hmc_walk', 'exponential_hmc_walk', 'hmc_leapfrog_gaussian', 'hmc_leapfrog_exponential', 'shake_and_bake', 'billiard_shake_and_bake'} n -- the number of steady states to sample burn_in -- the number of points to burn before sampling thinning -- the walk length of the chain @@ -223,7 +223,7 @@ def sample_from_polytope_no_multiphase( Keyword arguments: A -- an mxn matrix that contains the normal vectors of the facets of the polytope row-wise b -- a m-dimensional vector, s.t. A*x <= b - method -- An MCMC method to sample, i.e. {'billiard_walk', 'cdhr', 'rdhr', 'ball_walk', 'dikin_walk', 'john_walk', 'vaidya_walk', 'gaussian_hmc_walk', 'exponential_hmc_walk', 'hmc_leapfrog_gaussian', 'hmc_leapfrog_exponential'} + method -- An MCMC method to sample, i.e. {'billiard_walk', 'cdhr', 'rdhr', 'ball_walk', 'dikin_walk', 'john_walk', 'vaidya_walk', 'gaussian_hmc_walk', 'exponential_hmc_walk', 'hmc_leapfrog_gaussian', 'hmc_leapfrog_exponential', 'shake_and_bake', 'billiard_shake_and_bake'} n -- the number of steady states to sample burn_in -- the number of points to burn before sampling thinning -- the walk length of the chain diff --git a/dingo/bindings/bindings.cpp b/dingo/bindings/bindings.cpp index 0e3a62f..072b655 100644 --- a/dingo/bindings/bindings.cpp +++ b/dingo/bindings/bindings.cpp @@ -134,6 +134,14 @@ double HPolytopeCPP::apply_sampling(int walk_len, } else if (strcmp(method, "vaidya_walk")) { // vaidya walk uniform_sampling(rand_points, HP, rng, walk_len, number_of_points, starting_point, number_of_points_to_burn); + } else if (strcmp(method, "shake_and_bake") == 0) { // shake and bake walk + auto [boundary_pt, facet_idx] = compute_boundary_point(HP, rng, static_cast(1e-10)); + shakeandbake_sampling(rand_points,HP, rng, walk_len,number_of_points, + boundary_pt,number_of_points_to_burn, facet_idx); + } else if (strcmp(method, "billiard_shake_and_bake") == 0) { // billiard shake and bake walk + auto [boundary_pt, facet_idx] = compute_boundary_point(HP, rng, static_cast(1e-10)); + billiard_shakeandbake_sampling(randPoints, P, rng, walkL,nreflections, numpoints, + StartingPoint, nburns, facet_index); } else if (strcmp(method, "mmcs")) { // vaidya walk MT S; int total_ess; diff --git a/dingo/bindings/bindings.h b/dingo/bindings/bindings.h index 553ea99..43f38d9 100644 --- a/dingo/bindings/bindings.h +++ b/dingo/bindings/bindings.h @@ -34,6 +34,7 @@ #include #include "sampling/sampling.hpp" #include "ode_solvers/ode_solvers.hpp" +#include "preprocess/feasible_point.hpp" // for rounding #include "preprocess/min_sampling_covering_ellipsoid_rounding.hpp" diff --git a/dingo/volestipy.pyx b/dingo/volestipy.pyx index 6e8d3a9..0274195 100644 --- a/dingo/volestipy.pyx +++ b/dingo/volestipy.pyx @@ -85,7 +85,7 @@ cdef extern from "bindings.h": # Lists with the methods supported by volesti for volume approximation and random walk volume_methods = ["sequence_of_balls".encode("UTF-8"), "cooling_gaussian".encode("UTF-8"), "cooling_balls".encode("UTF-8")] walk_methods = ["uniform_ball".encode("UTF-8"), "CDHR".encode("UTF-8"), "RDHR".encode("UTF-8"), "gaussian_ball".encode("UTF-8"), \ - "gaussian_CDHR".encode("UTF-8"), "gaussian_RDHR".encode("UTF-8"), "uniform_ball".encode("UTF-8"), "billiard".encode("UTF-8")] + "gaussian_CDHR".encode("UTF-8"), "gaussian_RDHR".encode("UTF-8"), "uniform_ball".encode("UTF-8"), "billiard".encode("UTF-8"),"shake_and_bake".encode("UTF-8"),"billiard_shake_and_bake".encode("UTF-8") ] rounding_methods = ["min_ellipsoid".encode("UTF-8"), "svd".encode("UTF-8"), "max_ellipsoid".encode("UTF-8")] # Build the HPolytope class diff --git a/eigen b/eigen index 02f4200..5e8edd2 160000 --- a/eigen +++ b/eigen @@ -1 +1 @@ -Subproject commit 02f420012a169ed9267a8a78083aaa588e713353 +Subproject commit 5e8edd21863b8321fc6b9c82322e6cc8cfc47c14 diff --git a/volesti b/volesti index c3109bb..a33e5f4 160000 --- a/volesti +++ b/volesti @@ -1 +1 @@ -Subproject commit c3109bba06a9b623446bdde4c5fadb02722de876 +Subproject commit a33e5f450a8badb506384d7a619344dca855fe75