File: random.cc

package info (click to toggle)
libosl 0.6.0-3.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 148,792 kB
  • ctags: 151,985
  • sloc: cpp: 131,133; ansic: 7,228; ruby: 1,290; makefile: 569; perl: 309; sh: 35
file content (14 lines) | stat: -rw-r--r-- 304 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include "osl/misc/random.h"
#include <boost/random/mersenne_twister.hpp>
#include <time.h>
unsigned int osl::misc::random()
{
  static boost::mt11213b mt_random;
  return mt_random();
}

unsigned int osl::misc::time_seeded_random()
{
  static boost::mt11213b mt_random(time(0));
  return mt_random();
}