Skip to content

Commit

Permalink
fix RNGScope, broken in recent commit
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Jul 28, 2024
1 parent 6dbc635 commit 36f19bb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/rng_scope.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

class RNGScope {
igraph_rng_t *previous;
igraph_rng_t previous; // TODO for igraph 1.0, convert to pointer
igraph_rng_t current;

constexpr const static igraph_rng_type_t *default_type = &igraph_rngtype_pcg32;
Expand All @@ -18,7 +18,7 @@ class RNGScope {
}

// TODO for igraph 1.0 where igraph_rng_set_default() returns the previous generator.
previous = igraph_rng_default();
previous = *igraph_rng_default();
igraph_rng_set_default(&current);
}

Expand All @@ -34,7 +34,7 @@ class RNGScope {
RNGScope & operator = (RNGScope &&) = delete;

~RNGScope() {
igraph_rng_set_default(previous);
igraph_rng_set_default(&previous);
igraph_rng_destroy(&current);
}
};

0 comments on commit 36f19bb

Please sign in to comment.