41 #define OGDF_ASSERT(expr) 42 #define OGDF_HEAVY_ASSERT(expr) 47 # ifdef OGDF_HEAVY_DEBUG 48 # undef OGDF_HEAVY_ASSERT 49 # define OGDF_HEAVY_ASSERT(expr) OGDF_ASSERT(expr) 52 # ifndef OGDF_USE_ASSERT_EXCEPTIONS 54 # define OGDF_ASSERT(expr) assert(expr) 64 class AssertionFailed :
public std::runtime_error {
65 using std::runtime_error::runtime_error;
69 # define OGDF_ASSERT(expr) do { \ 71 std::stringstream ogdf_assert_ss; \ 73 << "OGDF assertion `" #expr "' failed at " __FILE__ ":" \ 75 << "(" << OGDF_FUNCTION_NAME << ")"; \ 76 ogdf::get_stacktrace(ogdf_assert_ss); \ 77 throw ogdf::AssertionFailed(ogdf_assert_ss.str()); \ 121 #ifdef OGDF_USE_ASSERT_EXCEPTIONS 122 extern void get_stacktrace(std::ostream &);
163 x1 = 2.0 * rndVal - 1.0;
165 double x2 = 2.0 * rndVal - 1.0;
169 w = sqrt((-2.0 * log(w))/w) ;
205 template<
typename CONTAINER,
typename T>
209 for (
const T &y : C) {
232 virtual int getBucket(
const E &x) = 0;
bool equalIgnoreCase(const string &str1, const string &str2)
Compares the two strings str1 and str2, ignoring the case of characters.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
double randomDoubleNormal(double m, double sd)
Returns a random double value from the normal distribution with mean m and standard deviation sd...
int randomNumber(int low, int high)
Returns random integer between low and high (including).
Basic configuration file.
static Initialization s_ogdfInitializer
bool debugMode
Set to true iff debug mode is used during compilation of the OGDF.
long unsigned int randomSeed()
Returns a random value suitable as initial seed for a random number engine.
void removeTrailingWhitespace(string &str)
Removes trailing space, horizontal and vertical tab, feed, newline, and carriage return from str...
double randomDouble(double low, double high)
Returns a random double value from the interval [low, high).
double usedTime(double &T)
Returns used CPU time from T to current time and assigns current time to T.
The class Initialization is used for initializing global variables.
Abstract base class for bucket functions.
The namespace for all OGDF objects.
bool prefixIgnoreCase(const string &prefix, const string &str)
Tests if prefix is a prefix of str, ignoring the case of characters.
void setSeed(int val)
Sets the seed for functions like randomSeed(), randomNumber(), randomDouble().
int searchPos(const CONTAINER &C, const T &x)
Searches for the position of x in container C; returns -1 if not found.