diff --git a/dingo/bindings/bindings.cpp b/dingo/bindings/bindings.cpp index 772a0aa7..b5549900 100644 --- a/dingo/bindings/bindings.cpp +++ b/dingo/bindings/bindings.cpp @@ -146,9 +146,9 @@ double HPolytopeCPP::apply_sampling(int walk_len, exponential_sampling(rand_points, HP, rng, walk_len, number_of_points, bias_vector, variance, starting_point, number_of_points_to_burn); } else if (method == 10) { // HMC with Gaussian distribution - rand_points = hmc_leapfrog_gaussian(walk_len, number_of_points, number_of_points_to_burn, samples, variance, bias_vector_, inner_point, radius, HP); + rand_points = hmc_leapfrog_gaussian(walk_len, number_of_points, number_of_points_to_burn, samples, variance, bias_vector_, starting_point, HP); } else if (method == 11) { // HMC with exponential distribution - rand_points = hmc_leapfrog_exponential(walk_len, number_of_points, number_of_points_to_burn, samples, variance, bias_vector_, inner_point, radius, HP); + rand_points = hmc_leapfrog_exponential(walk_len, number_of_points, number_of_points_to_burn, samples, variance, bias_vector_, starting_point, HP); } else { throw std::runtime_error("This function must not be called."); diff --git a/dingo/bindings/hmc_sampling.h b/dingo/bindings/hmc_sampling.h index db68d771..7bf4bb64 100644 --- a/dingo/bindings/hmc_sampling.h +++ b/dingo/bindings/hmc_sampling.h @@ -13,22 +13,9 @@ template list hmc_leapfrog_gaussian(int walk_len, double* samples, double variance, double* bias_vector_, - double* inner_point, - double radius, + Point starting_point, Polytope HP) { - int d = HP.dimension(); - Point starting_point; - VT inner_vec(d); - - for (int i = 0; i < d; i++){ - inner_vec(i) = inner_point[i]; - } - - Point inner_point2(inner_vec); - CheBall = std::pair(inner_point2, radius); - HP.set_InnerBall(CheBall); - starting_point = inner_point2; std::list rand_points; typedef GaussianFunctor::GradientFunctor NegativeGradientFunctor; @@ -65,21 +52,9 @@ template list hmc_leapfrog_exponential(int walk_len, double* samples, double variance, double* bias_vector_, - double* inner_point, - double radius, + Point starting_point, Polytope HP) { - Point starting_point; - VT inner_vec(d); - - for (int i = 0; i < d; i++){ - inner_vec(i) = inner_point[i]; - } - - Point inner_point2(inner_vec); - CheBall = std::pair(inner_point2, radius); - HP.set_InnerBall(CheBall); - starting_point = inner_point2; std::list rand_points; typedef ExponentialFunctor::GradientFunctor NegativeGradientFunctor; typedef ExponentialFunctor::FunctionFunctor NegativeLogprobFunctor;