X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0a97e88d294a5d816aabb986a20f3c63c5d4a349..43593083f5e507b563bddc7d8d9c6022a9d7fab4:/include/xbt/random.hpp diff --git a/include/xbt/random.hpp b/include/xbt/random.hpp index 83c8cbf240..81572c78ff 100644 --- a/include/xbt/random.hpp +++ b/include/xbt/random.hpp @@ -40,20 +40,12 @@ public: /** * @brief Read the state of the Mersenne-Twister RNG from a file */ - void read_state(std::string filename) - { - std::ifstream file(filename); - file >> mt19937_gen; - } + bool read_state(std::string filename); /** * @brief Write the state of the Mersenne-Twister RNG to a file */ - void write_state(std::string filename) - { - std::ofstream file(filename); - file << mt19937_gen; - } + bool write_state(std::string filename); /** * @brief Draws an integer number uniformly in range [min, max] (min and max included) @@ -133,14 +125,14 @@ void set_implem_std(); void set_mersenne_seed(int); /** - * @brief Read the state of the Mersenne-Twister RNG from a file + * @brief Read the state of the Mersenne-Twister RNG from a file. */ -void read_mersenne_state(std::string filename); +bool read_mersenne_state(std::string filename); /** - * @brief Write the state of the Mersenne-Twister RNG to a file + * @brief Write the state of the Mersenne-Twister RNG to a file. */ -void write_mersenne_state(std::string filename); +bool write_mersenne_state(std::string filename); /** * @brief Draws an integer number uniformly in range [min, max] (min and max included)