Skip to content

Commit

Permalink
remove re-initialization of eta
Browse files Browse the repository at this point in the history
  • Loading branch information
Apostolos Chalkis committed Oct 16, 2023
1 parent 49e6f23 commit 0577516
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R-proj/src/sample_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,
random_walks walk;
ode_solvers solver; // Used only for logconcave sampling

NT eta;
NT eta = 1;
std::list<Point> randPoints;
std::pair<Point, NT> InnerBall;
Point mode(dim);
Expand Down Expand Up @@ -410,7 +410,7 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,
Rcpp::Function negative_logprob = Rcpp::as<Rcpp::List>(distribution)["negative_logprob"];
Rcpp::Function negative_logprob_gradient = Rcpp::as<Rcpp::List>(distribution)["negative_logprob_gradient"];

NT L_, m, eta;
NT L_, m;

if (Rcpp::as<Rcpp::List>(distribution).containsElementNamed("L_")) {
L_ = Rcpp::as<NT>(Rcpp::as<Rcpp::List>(distribution)["L_"]);
Expand Down Expand Up @@ -459,8 +459,6 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,

functor_defined = false;

NT eta;

if (Rcpp::as<Rcpp::List>(random_walk).containsElementNamed("step_size")) {
eta = NT(Rcpp::as<NT>(Rcpp::as<Rcpp::List>(random_walk)["step_size"]));
if (eta <= NT(0)) {
Expand Down

0 comments on commit 0577516

Please sign in to comment.