#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.
74 {
75 return ( abs( maximumDifference ) >= abs( firstDouble - secondDouble ) );
76 }
◆ 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.
116 {
118 {
119
123 srand( time( NULL ) );
125 }
126 }
static bool randomSeedNotYetSet
◆ fileExists()
| bool BOL::UsefulStuff::fileExists |
( |
std::string const & |
fileName | ) |
|
|
inlinestatic |
Definition at line 129 of file UsefulStuff.hpp.
131 {
132 std::ifstream fileStream( fileName.c_str() );
133 if( fileStream.good() )
134 {
135 fileStream.close();
136 return true;
137 }
138 else
139 {
140 return false;
141 }
142 }
◆ flatRandomDouble()
| double BOL::UsefulStuff::flatRandomDouble |
( |
double const |
lowerLimit, |
|
|
double const |
upperLimit |
|
) |
| |
|
inlinestatic |
Definition at line 79 of file UsefulStuff.hpp.
85 {
87 return ( lowerLimit + ( (double)(rand()) / (double)RAND_MAX )
88 * ( upperLimit - lowerLimit ) );
89 }
static void ensureRandomSeedIsSet()
◆ plusOrMinusOne()
| int BOL::UsefulStuff::plusOrMinusOne |
( |
| ) |
|
|
inlinestatic |
Definition at line 100 of file UsefulStuff.hpp.
102 {
104 {
105 return -1;
106 }
107 else
108 {
109 return 1;
110 }
111 }
◆ runSystemCommand()
| void BOL::UsefulStuff::runSystemCommand |
( |
std::string const & |
systemCommand | ) |
|
|
inlinestatic |
Definition at line 145 of file UsefulStuff.hpp.
146 {
147 int systemReturn( system( systemCommand.c_str() ) );
148 if( -1 == systemReturn )
149 {
150 throw std::runtime_error( "system( \"" + systemCommand
151 + "\" ) returned -1" );
152 }
153 }
◆ 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: