OSspecific: Removed unused random generator functions
This commit is contained in:
@ -59,14 +59,6 @@ Description
|
||||
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef USE_RANDOM
|
||||
#include <climits>
|
||||
#if INT_MAX != 2147483647
|
||||
#error "INT_MAX != 2147483647"
|
||||
#error "The random number generator may not work!"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -1351,34 +1343,4 @@ Foam::fileNameList Foam::dlLoaded()
|
||||
}
|
||||
|
||||
|
||||
void Foam::osRandomSeed(const label seed)
|
||||
{
|
||||
#ifdef USE_RANDOM
|
||||
srandom((unsigned int)seed);
|
||||
#else
|
||||
srand48(seed);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::osRandomInteger()
|
||||
{
|
||||
#ifdef USE_RANDOM
|
||||
return random();
|
||||
#else
|
||||
return lrand48();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::osRandomDouble()
|
||||
{
|
||||
#ifdef USE_RANDOM
|
||||
return (scalar)random()/INT_MAX;
|
||||
#else
|
||||
return drand48();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -199,19 +199,6 @@ bool dlSymFound(void* handle, const std::string& symbol);
|
||||
//- Return all loaded libraries
|
||||
fileNameList dlLoaded();
|
||||
|
||||
|
||||
// Low level random numbers. Use Random class instead.
|
||||
|
||||
//- Seed random number generator.
|
||||
void osRandomSeed(const label seed);
|
||||
|
||||
//- Return random integer (uniform distribution between 0 and 2^31)
|
||||
label osRandomInteger();
|
||||
|
||||
//- Return random double precision (uniform distribution between 0 and 1)
|
||||
scalar osRandomDouble();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
Reference in New Issue
Block a user