Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

guma::random_des Class Reference

#include <guma_random.h>

List of all members.

Static Public Methods

double des_random (bool reset, gul::uint32 *idum)
double Random (void)

Static Public Attributes

GULAPI gul::uint32 cycle = 1
GULAPI gul::uint32 sequence = 1
GULAPI bool initialized = false


Member Function Documentation

double guma::random_des::des_random bool    reset,
gul::uint32   idum
[inline, static]
 

Definition at line 47 of file guma_random.h.

References LL, guma::PseudoDes(), and sequence.

Referenced by Random().

00048   {
00049     const double factor = 1.0/((double)LL(0x100000000));
00050     gul::uint32 irword,lword;
00051   
00052     if( reset )
00053     {
00054       sequence = *idum;
00055       *idum = 1;
00056     }
00057     irword = *idum;
00058     lword = sequence;
00059 
00060     PseudoDes( &lword, &irword );
00061 
00062     (*idum)++;
00063 
00064     return ((double)irword) * factor;
00065   }

double guma::random_des::Random void    [inline, static]
 

Definition at line 67 of file guma_random.h.

References cycle, des_random(), guma::GetSeed(), and initialized.

00068   {
00069     if( !initialized )
00070     {
00071       initialized = true;
00072       cycle = GetSeed();
00073       return des_random( true, &cycle );
00074     }
00075     return des_random( false, &cycle );
00076   }


Member Data Documentation

GULAPI uint32 guma::random_des::cycle = 1 [static]
 

Definition at line 85 of file guma_random.cpp.

Referenced by Random().

GULAPI bool guma::random_des::initialized = false [static]
 

Definition at line 83 of file guma_random.cpp.

Referenced by Random().

GULAPI uint32 guma::random_des::sequence = 1 [static]
 

Definition at line 84 of file guma_random.cpp.

Referenced by des_random().


The documentation for this class was generated from the following files:
Generated on Mon Jan 21 04:18:03 2002 for GUL 0.6 - Geometry Utility Library by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001