equal
deleted
inserted
replaced
75 #include <sys/time.h> |
75 #include <sys/time.h> |
76 #include <ctime> |
76 #include <ctime> |
77 #include <sys/types.h> |
77 #include <sys/types.h> |
78 #include <unistd.h> |
78 #include <unistd.h> |
79 #else |
79 #else |
80 #include <windows.h> |
80 #include <lemon/bits/windows.h> |
81 #endif |
81 #endif |
82 |
82 |
83 ///\ingroup misc |
83 ///\ingroup misc |
84 ///\file |
84 ///\file |
85 ///\brief Mersenne Twister random number generator |
85 ///\brief Mersenne Twister random number generator |
660 #ifndef WIN32 |
660 #ifndef WIN32 |
661 timeval tv; |
661 timeval tv; |
662 gettimeofday(&tv, 0); |
662 gettimeofday(&tv, 0); |
663 seed(getpid() + tv.tv_sec + tv.tv_usec); |
663 seed(getpid() + tv.tv_sec + tv.tv_usec); |
664 #else |
664 #else |
665 FILETIME time; |
665 seed(bits::getWinRndSeed()); |
666 GetSystemTimeAsFileTime(&time); |
|
667 seed(GetCurrentProcessId() + time.dwHighDateTime + time.dwLowDateTime); |
|
668 #endif |
666 #endif |
669 return true; |
667 return true; |
670 } |
668 } |
671 |
669 |
672 /// @} |
670 /// @} |