Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MPIrandomSeedGenerator Class Reference

#include <G4MPIrandomSeedGenerator.hh>

Inheritance diagram for G4MPIrandomSeedGenerator:
Collaboration diagram for G4MPIrandomSeedGenerator:

Public Member Functions

 G4MPIrandomSeedGenerator ()
 
 ~G4MPIrandomSeedGenerator ()
 
- Public Member Functions inherited from G4VMPIseedGenerator
 G4VMPIseedGenerator ()
 
virtual ~G4VMPIseedGenerator ()
 
void SetMasterSeed (G4long aseed)
 
G4long GetMasterSeed () const
 
const std::vector< G4long > & GetSeedList () const
 

Protected Member Functions

G4bool CheckDoubleCount ()
 
virtual void GenerateSeeds ()
 

Additional Inherited Members

- Protected Attributes inherited from G4VMPIseedGenerator
G4long master_seed_
 
std::vector< G4longseed_list_
 

Detailed Description

Definition at line 33 of file G4MPIrandomSeedGenerator.hh.

Constructor & Destructor Documentation

G4MPIrandomSeedGenerator::G4MPIrandomSeedGenerator ( )

Definition at line 34 of file G4MPIrandomSeedGenerator.cc.

Here is the call graph for this function:

G4MPIrandomSeedGenerator::~G4MPIrandomSeedGenerator ( )

Definition at line 41 of file G4MPIrandomSeedGenerator.cc.

42 {
43 }

Member Function Documentation

G4bool G4MPIrandomSeedGenerator::CheckDoubleCount ( )
protected

Definition at line 46 of file G4MPIrandomSeedGenerator.cc.

47 {
49 
50  G4int nsize = g4mpi-> GetSize();
51 
52  for ( G4int i = 0; i < nsize; i++ ) {
53  for ( G4int j = 0; j < nsize; j++ ) {
54  if( (i != j) && (seed_list_[i] == seed_list_[j]) ) {
56  seed_list_[j] = G4long(x*LONG_MAX);
57  return false;
58  }
59  }
60  }
61 
62  return true;
63 }
long G4long
Definition: G4Types.hh:80
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
static G4MPImanager * GetManager()
std::vector< G4long > seed_list_
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:

void G4MPIrandomSeedGenerator::GenerateSeeds ( )
protectedvirtual

Implements G4VMPIseedGenerator.

Definition at line 66 of file G4MPIrandomSeedGenerator.cc.

67 {
69 
70  G4int nsize = g4mpi-> GetSize();
71 
72  seed_list_.clear();
73 
74  for ( G4int i = 0; i < nsize; i++ ) {
76  G4int seed = G4long(x*LONG_MAX);
77  seed_list_.push_back(seed);
78  }
79 
80  while(! CheckDoubleCount()) {
81  continue;
82  }
83 }
long G4long
Definition: G4Types.hh:80
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
long seed
Definition: chem4.cc:68
static G4MPImanager * GetManager()
std::vector< G4long > seed_list_
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: