ADMB Documentation  11.1x.2735
 All Classes Files Functions Variables Typedefs Friends Defines
bet_rand.cpp
Go to the documentation of this file.
00001 /*
00002  * $Id: bet_rand.cpp 2572 2014-11-06 18:00:13Z johnoel $
00003  *
00004  * Author: David Fournier
00005  * Copyright (c) 2009-2012 ADMB foundation
00006  */
00011 #include <fvar.hpp>
00012 #ifndef OPT_LIB
00013   #include <cassert>
00014   #include <climits>
00015 #endif
00016 
00021 double better_rand(long int& idum)
00022 {
00023 #ifndef OPT_LIB
00024   assert(idum <= INT_MAX);
00025 #endif
00026   random_number_generator rng((int)idum);
00027   double rr = ((random_number_generator&) rng).better_rand();
00028   return rr;
00029 }