Storm
1.10.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
math.h
Go to the documentation of this file.
1
#ifndef STORM_UTILITY_MATH_H_
2
#define STORM_UTILITY_MATH_H_
3
4
#include <cmath>
5
#include "
storm/utility/macros.h
"
6
7
namespace
storm
{
8
namespace
utility {
9
namespace
math {
10
11
inline
uint64_t
uint64_log2
(uint64_t n) {
12
STORM_LOG_ASSERT
(n != 0,
"N is 0."
);
13
#define S(k) \
14
if (n >= (UINT64_C(1) << k)) { \
15
i += k; \
16
n >>= k; \
17
}
18
uint64_t i = 0;
19
S
(32);
20
S
(16);
21
S
(8);
22
S
(4);
23
S
(2);
24
S
(1);
25
return
i;
26
#undef S
27
}
28
}
// namespace math
29
}
// namespace utility
30
}
// namespace storm
31
32
#endif
/* STORM_UTILITY_MATH_H_ */
macros.h
STORM_LOG_ASSERT
#define STORM_LOG_ASSERT(cond, message)
Definition
macros.h:11
S
#define S(k)
storm::utility::math::uint64_log2
uint64_t uint64_log2(uint64_t n)
Definition
math.h:11
storm
LabParser.cpp.
Definition
AutomaticSettings.cpp:13
src
storm
utility
math.h
Generated by
1.9.8