File: random.cc

package info (click to toggle)
libosl 0.5.0-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 273,976 kB
  • sloc: cpp: 129,625; ansic: 7,145; ruby: 1,290; makefile: 558; perl: 413; 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();
}