00001 // ======================================================================================== 00002 // ApproxMVBB 00003 // Copyright (C) 2014 by Gabriel Nützi <nuetzig (at) imes (d0t) mavt (d0t) ethz (døt) ch> 00004 // 00005 // This Source Code Form is subject to the terms of the Mozilla Public 00006 // License, v. 2.0. If a copy of the MPL was not distributed with this 00007 // file, You can obtain one at http://mozilla.org/MPL/2.0/. 00008 // ======================================================================================== 00009 00010 #include "ApproxMVBB/Diameter/Utils/rand.hpp" 00011 00012 namespace ApproxMVBB{ 00013 00014 // 00015 // static long int _random_calls_ = 0; 00016 // static long int _random_seed_ = 0; 00017 // 00018 // long int _GetRandomCalls() 00019 // { 00020 // return( _random_calls_ ); 00021 // } 00022 // 00023 // long int _GetRandomSeed() 00024 // { 00025 // return( _random_seed_ ); 00026 // } 00027 // 00028 // 00029 // 00030 // #if defined _WIN32 || defined __CYGWIN__ || defined WIN32 // WIN32 is for legacy CMake 00031 // void _SetRandomSeed( unsigned int seed ) 00032 // { 00033 // srand( seed ); 00034 // _random_seed_ = seed; 00035 // _random_calls_ = 0; 00036 // } 00037 // #else 00038 // void _SetRandomSeed( long int seed ) 00039 // { 00040 // srand48( seed ); 00041 // //_random_seed_ = seed; 00042 // _random_calls_ = 0; 00043 // } 00044 // #endif 00045 // 00046 // 00047 // 00048 // #if defined _WIN32 || defined __CYGWIN__ || defined WIN32 // WIN32 is for legacy CMake 00049 // double _GetRandomDoubleNb( ) 00050 // { 00051 // //_random_calls_ ++; 00052 // return( (double)rand()/(double)RAND_MAX ); 00053 // } 00054 // #else 00055 // double _GetRandomDoubleNb( ) 00056 //{ 00057 //_random_calls_ ++; 00058 // return( drand48() ); 00059 // } 00060 // #endif 00061 // 00062 // 00063 // int _GetRandomIntNb( int min, int max ) 00064 // { 00065 // if ( min <= max ) 00066 // return( (int)(floor( min + _GetRandomDoubleNb()*(double)(max-min+1.0) )) ); 00067 // return( (int)(floor( max + _GetRandomDoubleNb()*(double)(min-max+1.0) )) ); 00068 // } 00069 00070 }