Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

RandC.cpp

Go to the documentation of this file.
00001 #include "./randc.h"
00002 #include "../../common/types.h"
00003 #include <stdlib.h>
00004 #include <time.h>
00005 
00006 const Natural Maxim=32767;
00007 
00008 RandC::RandC(LongNatural Seed_)
00009 {
00010         Seed=Seed_;
00011         srand(time(NULL));
00012 }
00013 
00014 RandC::~RandC(void)
00015 {
00016 }
00017 
00018 VeryLongNatural RandC::Max() {
00019     return Maxim;
00020 }
00021 
00022 LongNatural RandC::Min() {
00023     return 1;
00024 }
00025 
00026 LongNatural RandC::GetOneRandomInteger() {
00027     return rand()%Maxim+1;
00028 }
00029 
00030 Real RandC::getUniform() {
00031         return (GetOneRandomInteger()-0.5)/Real(Max());
00032 }
00033 
00034 void RandC::SetSeed(LongNatural Seed_) {
00035   Seed=Seed_;
00036 }
00037 

Note: Generated nightly - reload for latest version
Generated on Thu Dec 22 23:12:37 2005 for terreneuve by doxygen 1.3.6