IceRandom.cpp
Go to the documentation of this file.
00001 
00002 
00008 
00009 
00011 // Precompiled Header
00012 #include "Stdafx.h"
00013 
00014 using namespace IceCore;
00015 
00016 void IceCore::	SRand(udword seed)
00017 {
00018         srand(seed);
00019 }
00020 
00021 udword IceCore::Rand()
00022 {
00023         return rand();
00024 }
00025 
00026 
00027 static BasicRandom gRandomGenerator(42);
00028 
00029 udword IceCore::GetRandomIndex(udword max_index)
00030 {
00031         // We don't use rand() since it's limited to RAND_MAX
00032         udword Index = gRandomGenerator.Randomize();
00033         return Index % max_index;
00034 }
00035 


openhrp3
Author(s): AIST, General Robotix Inc., Nakamura Lab of Dept. of Mechano Informatics at University of Tokyo
autogenerated on Thu Apr 11 2019 03:30:17