#include <UsefulStuff.hpp>
Definition at line 25 of file UsefulStuff.hpp.
◆ doublesCloseEnough()
bool BOL::UsefulStuff::doublesCloseEnough |
( |
double const |
firstDouble, |
|
|
double const |
secondDouble, |
|
|
double |
maximumDifference |
|
) |
| |
|
inlinestatic |
Definition at line 69 of file UsefulStuff.hpp.
75 return ( abs( maximumDifference ) >= abs( firstDouble - secondDouble ) );
◆ ensureRandomSeedIsSet()
void BOL::UsefulStuff::ensureRandomSeedIsSet |
( |
| ) |
|
|
inlinestaticprivate |
time_t currentTime = time( NULL ); srand( currentTime ); std::cout << std::endl << "currentTime = " << currentTime;
Definition at line 114 of file UsefulStuff.hpp.
123 srand( time( NULL ) );
static bool randomSeedNotYetSet
◆ fileExists()
bool BOL::UsefulStuff::fileExists |
( |
std::string const & |
fileName | ) |
|
|
inlinestatic |
Definition at line 129 of file UsefulStuff.hpp.
132 std::ifstream fileStream( fileName.c_str() );
133 if( fileStream.good() )
◆ flatRandomDouble()
double BOL::UsefulStuff::flatRandomDouble |
( |
double const |
lowerLimit, |
|
|
double const |
upperLimit |
|
) |
| |
|
inlinestatic |
Definition at line 79 of file UsefulStuff.hpp.
87 return ( lowerLimit + ( (
double)(rand()) / (
double)RAND_MAX )
88 * ( upperLimit - lowerLimit ) );
static void ensureRandomSeedIsSet()
◆ plusOrMinusOne()
int BOL::UsefulStuff::plusOrMinusOne |
( |
| ) |
|
|
inlinestatic |
◆ runSystemCommand()
void BOL::UsefulStuff::runSystemCommand |
( |
std::string const & |
systemCommand | ) |
|
|
inlinestatic |
Definition at line 145 of file UsefulStuff.hpp.
147 int systemReturn( system( systemCommand.c_str() ) );
148 if( -1 == systemReturn )
150 throw std::runtime_error(
"system( \"" + systemCommand
151 +
"\" ) returned -1" );
◆ zeroOrOne()
int BOL::UsefulStuff::zeroOrOne |
( |
| ) |
|
|
inlinestatic |
◆ nanString
std::string const BOL::UsefulStuff::nanString |
|
static |
◆ notANumber
double const BOL::UsefulStuff::notANumber |
|
static |
◆ randomSeedNotYetSet
bool BOL::UsefulStuff::randomSeedNotYetSet |
|
staticprivate |
◆ twicePi
double const BOL::UsefulStuff::twicePi |
|
static |
The documentation for this class was generated from the following files: