1#ifndef RAIIGRAPH_RNG_SCOPE_HPP
2#define RAIIGRAPH_RNG_SCOPE_HPP
35 RNGScope(igraph_uint_t seed,
const igraph_rng_type_t* type) {
38 auto errcode = igraph_rng_seed(¤t, seed);
39 if (errcode != IGRAPH_SUCCESS) {
40 igraph_rng_destroy(¤t);
44 previous = *(igraph_rng_default());
45 igraph_rng_set_default(¤t);
55 previous = *(igraph_rng_default());
56 igraph_rng_set_default(¤t);
75 igraph_rng_set_default(&previous);
76 igraph_rng_destroy(¤t);
83 igraph_rng_t previous;
Error class for igraph-related errors.
Definition error.hpp:16
Control the igraph RNG via RAII.
Definition RNGScope.hpp:20
RNGScope(const igraph_rng_type_t *type)
Definition RNGScope.hpp:53
RNGScope()
Definition RNGScope.hpp:62
RNGScope(igraph_uint_t seed)
Definition RNGScope.hpp:27
RNGScope(igraph_uint_t seed, const igraph_rng_type_t *type)
Definition RNGScope.hpp:35
Error handling for raiigraph.
Utilities for manipulating igraph data structures in C++.
Definition error.hpp:11
void check_code(igraph_error_t code)
Definition error.hpp:34