Skip to content

Commit

Permalink
Minor patch to graph (forgot to fix from last merge)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Oct 29, 2024
1 parent c1a1836 commit 8b510fa
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions include/epiworld/random_graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class RandGraph {

private:
std::shared_ptr< std::mt19937 > engine;
std::shared_ptr< std::uniform_real_distribution<> > unifd;
std::uniform_real_distribution<> unifd;
int N = 0;
bool initialized = false;

Expand All @@ -27,9 +27,6 @@ inline void RandGraph::init(int s) {

engine->seed(s);

if (!unifd)
unifd = std::make_shared< std::uniform_real_distribution<> >(0, 1);

initialized = true;


Expand All @@ -47,7 +44,7 @@ inline epiworld_double RandGraph::runif() {
if (!initialized)
throw std::logic_error("The object has not been initialized");

return (*unifd)(engine);
return unifd(*engine);

}

Expand Down

0 comments on commit 8b510fa

Please sign in to comment.