Skip to content

Commit

Permalink
Only close over rng (Issue #2881)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbbales2 committed Mar 9, 2021
1 parent 6925d77 commit 13d139f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stan/mcmc/hmc/hamiltonians/diag_e_metric.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class diag_e_metric : public base_hamiltonian<Model, diag_e_point, BaseRNG> {
rand_diag_gaus(rng, boost::normal_distribution<>());

z.p = z.get_inv_metric().unaryExpr(
[&](auto&& x) { return rand_diag_gaus() / sqrt(x); });
[&rand_diag_gaus](auto&& x) { return rand_diag_gaus() / sqrt(x); });
}
};

Expand Down

0 comments on commit 13d139f

Please sign in to comment.