Skip to content

Commit

Permalink
Add seed param to lfmcmc run function
Browse files Browse the repository at this point in the history
  • Loading branch information
apulsipher committed Nov 4, 2024
1 parent 884f49c commit cf596be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion include/epiworld/math/lfmcmc/lfmcmc-bones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ class LFMCMC {
void run(
std::vector< epiworld_double > param_init,
size_t n_samples_,
epiworld_double epsilon_
epiworld_double epsilon_,
int seed = -1
);

LFMCMC() {};
Expand Down
6 changes: 5 additions & 1 deletion include/epiworld/math/lfmcmc/lfmcmc-meat.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ template<typename TData>
inline void LFMCMC<TData>::run(
std::vector< epiworld_double > params_init_,
size_t n_samples_,
epiworld_double epsilon_
epiworld_double epsilon_,
int seed = -1
)
{

Expand All @@ -218,6 +219,9 @@ inline void LFMCMC<TData>::run(
params_init = params_init_;
n_parameters = params_init_.size();

if (seed >= 0)
this->seed(seed);

params_now.resize(n_parameters);
params_prev.resize(n_parameters);

Expand Down

0 comments on commit cf596be

Please sign in to comment.