50#if defined(WIN32) || defined(__MINGW32__)
63 G4int errcode = posix_memalign((
void**) &buffer,
sizeof(
G4double) * CHAR_BIT,
67 G4Exception(
"G4UniformRandPool::create_pool_align()",
"InvalidCondition",
79 if(
sizeof(
G4double) * CHAR_BIT == 64)
93 if(
sizeof(
G4double) * CHAR_BIT == 64)
106 if(
sizeof(
G4double) * CHAR_BIT == 64)
128void G4UniformRandPool::Fill(
G4int howmany)
130 assert(howmany > 0 && howmany <= size);
134 G4Random::getTheEngine()->flatArray(howmany, buffer);
140 assert(rnds != 0 && howmany > 0);
149 const G4int maxcycles = howmany / size;
153 const G4int peel = howmany % size;
165 if(maxcycles > 0 && currentIdx > 0)
167 assert(currentIdx <= size);
170 for(; cycle < maxcycles; ++cycle)
176 memcpy(rnds + (cycle * size), buffer,
sizeof(
G4double) * size);
190 if(currentIdx + peel >= size)
192 Fill(currentIdx < size ? currentIdx : size);
194 memcpy(rnds + (cycle * size), buffer + currentIdx,
sizeof(
G4double) * peel);
200 assert(currentIdx <= size);
212 if(rndpool ==
nullptr)
217 return rndpool->GetOne();
222 if(rndpool ==
nullptr)
227 rndpool->GetMany(rnds, (
unsigned int) howmany);
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)