|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
52 #define OGDF_ASSERT(expr)
53 #define OGDF_HEAVY_ASSERT(expr)
58 # ifdef OGDF_HEAVY_DEBUG
59 # undef OGDF_HEAVY_ASSERT
60 # define OGDF_HEAVY_ASSERT(expr) OGDF_ASSERT(expr)
63 # ifndef OGDF_USE_ASSERT_EXCEPTIONS
66 # define OGDF_ASSERT(expr) assert(expr)
75 class AssertionFailed :
public std::runtime_error {
76 using std::runtime_error::runtime_error;
80 # define OGDF_ASSERT(expr) \
83 std::stringstream ogdf_assert_ss; \
84 ogdf_assert_ss << "OGDF assertion `" #expr "' failed at " __FILE__ ":" \
85 << __LINE__ << "(" << OGDF_FUNCTION_NAME << ")"; \
86 ogdf::get_stacktrace(ogdf_assert_ss); \
87 OGDF_DISABLE_WARNING_PUSH \
88 OGDF_DISABLE_WARNING_THROW_TERMINATE \
89 throw ogdf::AssertionFailed(ogdf_assert_ss.str()); \
90 OGDF_DISABLE_WARNING_POP \
98 #define OGDF_IF_DBG(x)
101 # define OGDF_IF_DBG(x) x
108 #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
109 # define OGDF_TRIVIALLY_COPYABLE std::has_trivial_copy_assign
111 # define OGDF_TRIVIALLY_COPYABLE std::is_trivially_copyable
145 #ifdef OGDF_USE_ASSERT_EXCEPTIONS
146 OGDF_EXPORT extern void get_stacktrace(std::ostream& stream);
186 x1 = 2.0 * rndVal - 1.0;
188 double x2 = 2.0 * rndVal - 1.0;
189 w = x1 * x1 + x2 * x2;
192 w = sqrt((-2.0 *
log(w)) / w);
235 template<
typename CONTAINER,
typename T>
238 for (
const T& y : C) {
The namespace for all OGDF objects.
The class Initialization is used for initializing global variables.
Abstract base class for bucket functions.
int searchPos(const CONTAINER &C, const T &x)
Searches for the position of x in container C; returns -1 if not found.
bool debugMode
Set to true iff debug mode is used during compilation of the OGDF.
static Initialization s_ogdfInitializer
#define OGDF_DISABLE_WARNING_DEPRECATED
Disable deprecation warnings.
#define OGDF_DISABLE_WARNING_POP
End the current warning configuration context (i.e. do pragma diagnostic/warning pop)
double randomDoubleExponential(double beta)
Returns a random double value from the exponential distribution.
bool equalIgnoreCase(const string &str1, const string &str2)
Compares the two strings str1 and str2, ignoring the case of characters.
#define OGDF_DISABLE_WARNING_PUSH
Start a new warning configuration context (i.e. do pragma diagnostic/warning push)
void setSeed(int val)
Sets the seed for functions like randomSeed(), randomNumber(), randomDouble().
long unsigned int randomSeed()
Returns a random value suitable as initial seed for a random number engine.
double randomDoubleNormal(double m, double sd)
Returns a random double value from the normal distribution with mean m and standard deviation sd.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Basic configuration file.
bool prefixIgnoreCase(const string &prefix, const string &str)
Tests if prefix is a prefix of str, ignoring the case of characters.
void removeTrailingWhitespace(string &str)
Removes trailing space, horizontal and vertical tab, feed, newline, and carriage return from str.
int randomNumber(int low, int high)
Returns random integer between low and high (including).
double usedTime(double &T)
Returns used CPU time from T to current time and assigns current time to T.
virtual int getBucket(const E &x)=0
Returns the bucket of x.
double randomDouble(double low, double high)
Returns a random double value from the interval [low, high).