1/* 2 * Copyright (c) 2003-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 28 unchanged lines hidden (view full) --- 37 */ 38 39#ifndef __BASE_RANDOM_HH__ 40#define __BASE_RANDOM_HH__ 41 42#include <ios> 43#include <string> 44 |
45#include "base/types.hh" 46 47class Checkpoint; 48 49class Random 50{ 51 protected: 52 static const int N = 624; --- 151 unchanged lines hidden (view full) --- 204 205 template <typename T> 206 T 207 random(T min, T max) 208 { 209 return _random(min, max); 210 } 211 |
212 // [0,1] 213 double 214 gen_real1() 215 { 216 return genrand() / 4294967296.0; 217 } 218 219 // [0,1) --- 22 unchanged lines hidden --- |