GCC Code Coverage Report


Directory: ./
File: openvdb/openvdb/math/Math.h
Date: 2022-07-25 17:40:05
Exec Total Coverage
Lines: 71 80 88.8%
Functions: 16 33 48.5%
Branches: 946 5621 16.8%

Line Branch Exec Source
1 // Copyright Contributors to the OpenVDB Project
2 // SPDX-License-Identifier: MPL-2.0
3 //
4 /// @file Math.h
5 /// @brief General-purpose arithmetic and comparison routines, most of which
6 /// accept arbitrary value types (or at least arbitrary numeric value types)
7
8 #ifndef OPENVDB_MATH_HAS_BEEN_INCLUDED
9 #define OPENVDB_MATH_HAS_BEEN_INCLUDED
10
11 #include <openvdb/Platform.h>
12 #include <openvdb/version.h>
13 #include <boost/numeric/conversion/conversion_traits.hpp>
14 #include <algorithm> // for std::max()
15 #include <cassert>
16 #include <cmath> // for std::ceil(), std::fabs(), std::pow(), std::sqrt(), etc.
17 #include <cstdlib> // for abs(int)
18 #include <cstring> // for memcpy
19 #include <random>
20 #include <string>
21 #include <type_traits> // for std::is_arithmetic
22
23
24 // Compile pragmas
25
26 // Intel(r) compiler fires remark #1572: floating-point equality and inequality
27 // comparisons are unrealiable when == or != is used with floating point operands.
28 #if defined(__INTEL_COMPILER)
29 #define OPENVDB_NO_FP_EQUALITY_WARNING_BEGIN \
30 _Pragma("warning (push)") \
31 _Pragma("warning (disable:1572)")
32 #define OPENVDB_NO_FP_EQUALITY_WARNING_END \
33 _Pragma("warning (pop)")
34 #elif defined(__clang__)
35 #define OPENVDB_NO_FP_EQUALITY_WARNING_BEGIN \
36 PRAGMA(clang diagnostic push) \
37 PRAGMA(clang diagnostic ignored "-Wfloat-equal")
38 #define OPENVDB_NO_FP_EQUALITY_WARNING_END \
39 PRAGMA(clang diagnostic pop)
40 #else
41 // For GCC, #pragma GCC diagnostic ignored "-Wfloat-equal"
42 // isn't working until gcc 4.2+,
43 // Trying
44 // #pragma GCC system_header
45 // creates other problems, most notably "warning: will never be executed"
46 // in from templates, unsure of how to work around.
47 // If necessary, could use integer based comparisons for equality
48 #define OPENVDB_NO_FP_EQUALITY_WARNING_BEGIN
49 #define OPENVDB_NO_FP_EQUALITY_WARNING_END
50 #endif
51
52
53 #ifdef OPENVDB_IS_POD
54 #undef OPENVDB_IS_POD
55 #endif
56 #define OPENVDB_IS_POD(Type) \
57 static_assert(std::is_standard_layout<Type>::value, \
58 #Type" must be a POD type (satisfy StandardLayoutType.)"); \
59 static_assert(std::is_trivial<Type>::value, \
60 #Type" must be a POD type (satisfy TrivialType.)");
61
62 namespace openvdb {
63 OPENVDB_USE_VERSION_NAMESPACE
64 namespace OPENVDB_VERSION_NAME {
65
66 /// @brief Return the value of type T that corresponds to zero.
67 /// @note A zeroVal<T>() specialization must be defined for each @c ValueType T
68 /// that cannot be constructed using the form @c T(0). For example, @c std::string(0)
69 /// treats 0 as @c nullptr and throws a @c std::logic_error.
70
85/396
✓ Branch 1 taken 367 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✓ Branch 5 taken 1 times.
✓ Branch 6 taken 512 times.
✓ Branch 7 taken 554 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 22 times.
✓ Branch 10 taken 26 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 22 times.
✓ Branch 13 taken 77 times.
✓ Branch 14 taken 2 times.
✗ Branch 15 not taken.
✓ Branch 16 taken 39 times.
✓ Branch 17 taken 3 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 24 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 3 times.
✗ Branch 23 not taken.
✓ Branch 24 taken 21 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 884 times.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✓ Branch 35 taken 50 times.
✓ Branch 36 taken 2 times.
✓ Branch 37 taken 28 times.
✗ Branch 38 not taken.
✓ Branch 39 taken 3 times.
✓ Branch 40 taken 76 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 16 times.
✓ Branch 43 taken 9 times.
✓ Branch 44 taken 1 times.
✓ Branch 45 taken 6 times.
✗ Branch 46 not taken.
✓ Branch 47 taken 1 times.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✓ Branch 50 taken 2 times.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✓ Branch 53 taken 1 times.
✗ Branch 54 not taken.
✓ Branch 55 taken 8 times.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✓ Branch 69 taken 4 times.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✓ Branch 79 taken 6 times.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✓ Branch 86 taken 2 times.
✗ Branch 87 not taken.
✓ Branch 88 taken 32 times.
✓ Branch 89 taken 1 times.
✗ Branch 90 not taken.
✓ Branch 91 taken 1 times.
✓ Branch 92 taken 17 times.
✗ Branch 93 not taken.
✓ Branch 94 taken 1 times.
✓ Branch 95 taken 1 times.
✗ Branch 96 not taken.
✓ Branch 97 taken 1 times.
✓ Branch 98 taken 1 times.
✗ Branch 99 not taken.
✓ Branch 100 taken 513 times.
✓ Branch 101 taken 1 times.
✗ Branch 102 not taken.
✓ Branch 103 taken 513 times.
✓ Branch 104 taken 1 times.
✗ Branch 105 not taken.
✓ Branch 106 taken 1 times.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✓ Branch 109 taken 1 times.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✓ Branch 112 taken 513 times.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✓ Branch 115 taken 1 times.
✗ Branch 116 not taken.
✓ Branch 117 taken 17 times.
✓ Branch 118 taken 513 times.
✗ Branch 119 not taken.
✓ Branch 120 taken 16 times.
✓ Branch 121 taken 1 times.
✗ Branch 122 not taken.
✓ Branch 123 taken 16 times.
✓ Branch 124 taken 1 times.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✓ Branch 127 taken 4 times.
✗ Branch 128 not taken.
✓ Branch 129 taken 24 times.
✗ Branch 130 not taken.
✓ Branch 131 taken 52 times.
✓ Branch 132 taken 25 times.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✓ Branch 138 taken 24 times.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✓ Branch 141 taken 78 times.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 168 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 171 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 177 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✗ Branch 185 not taken.
✓ Branch 186 taken 1 times.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✓ Branch 189 taken 1 times.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✓ Branch 192 taken 1 times.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✓ Branch 195 taken 1 times.
✗ Branch 196 not taken.
✗ Branch 197 not taken.
✓ Branch 198 taken 1 times.
✗ Branch 199 not taken.
✗ Branch 200 not taken.
✓ Branch 201 taken 1 times.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✓ Branch 204 taken 1 times.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✗ Branch 207 not taken.
✗ Branch 208 not taken.
✓ Branch 210 taken 1 times.
✗ Branch 211 not taken.
✗ Branch 212 not taken.
✗ Branch 213 not taken.
✓ Branch 214 taken 1 times.
✗ Branch 215 not taken.
✗ Branch 216 not taken.
✗ Branch 217 not taken.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✓ Branch 221 taken 1 times.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 224 not taken.
✓ Branch 225 taken 1 times.
✗ Branch 226 not taken.
✗ Branch 227 not taken.
✓ Branch 228 taken 13 times.
✗ Branch 229 not taken.
✗ Branch 230 not taken.
✓ Branch 231 taken 1 times.
✗ Branch 232 not taken.
✗ Branch 233 not taken.
✗ Branch 234 not taken.
✗ Branch 235 not taken.
✗ Branch 236 not taken.
✗ Branch 237 not taken.
✗ Branch 238 not taken.
✗ Branch 239 not taken.
✗ Branch 240 not taken.
✗ Branch 241 not taken.
✗ Branch 242 not taken.
✗ Branch 243 not taken.
✗ Branch 244 not taken.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✗ Branch 249 not taken.
✗ Branch 250 not taken.
✗ Branch 252 not taken.
✗ Branch 253 not taken.
✗ Branch 254 not taken.
✗ Branch 255 not taken.
✗ Branch 256 not taken.
✗ Branch 257 not taken.
✗ Branch 258 not taken.
✗ Branch 259 not taken.
✗ Branch 260 not taken.
✗ Branch 261 not taken.
✗ Branch 262 not taken.
✗ Branch 263 not taken.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✓ Branch 276 taken 1 times.
✗ Branch 277 not taken.
✗ Branch 279 not taken.
✗ Branch 280 not taken.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✗ Branch 283 not taken.
✗ Branch 284 not taken.
✗ Branch 285 not taken.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✗ Branch 288 not taken.
✗ Branch 289 not taken.
✗ Branch 290 not taken.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
✗ Branch 293 not taken.
✗ Branch 294 not taken.
✗ Branch 295 not taken.
✗ Branch 296 not taken.
✗ Branch 297 not taken.
✗ Branch 298 not taken.
✗ Branch 300 not taken.
✗ Branch 301 not taken.
✗ Branch 302 not taken.
✗ Branch 303 not taken.
✗ Branch 304 not taken.
✗ Branch 306 not taken.
✗ Branch 307 not taken.
✗ Branch 309 not taken.
✗ Branch 310 not taken.
✗ Branch 311 not taken.
✗ Branch 312 not taken.
✗ Branch 313 not taken.
✗ Branch 314 not taken.
✗ Branch 315 not taken.
✗ Branch 316 not taken.
✗ Branch 317 not taken.
✗ Branch 318 not taken.
✗ Branch 319 not taken.
✗ Branch 320 not taken.
✗ Branch 321 not taken.
✗ Branch 322 not taken.
✗ Branch 323 not taken.
✓ Branch 324 taken 5 times.
✗ Branch 325 not taken.
✗ Branch 326 not taken.
✗ Branch 327 not taken.
✗ Branch 328 not taken.
✗ Branch 329 not taken.
✗ Branch 330 not taken.
✗ Branch 331 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 336 not taken.
✓ Branch 337 taken 114 times.
✗ Branch 338 not taken.
✗ Branch 339 not taken.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✗ Branch 342 not taken.
✓ Branch 343 taken 112 times.
✗ Branch 344 not taken.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✗ Branch 348 not taken.
✓ Branch 349 taken 130 times.
✗ Branch 350 not taken.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✗ Branch 353 not taken.
✗ Branch 354 not taken.
✓ Branch 355 taken 188 times.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✓ Branch 361 taken 98 times.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✗ Branch 364 not taken.
✗ Branch 365 not taken.
✗ Branch 366 not taken.
✓ Branch 367 taken 98 times.
✗ Branch 368 not taken.
✗ Branch 369 not taken.
✗ Branch 370 not taken.
✗ Branch 371 not taken.
✗ Branch 372 not taken.
✓ Branch 373 taken 98 times.
✗ Branch 374 not taken.
✗ Branch 375 not taken.
✗ Branch 376 not taken.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✗ Branch 379 not taken.
✗ Branch 381 not taken.
✗ Branch 382 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 387 not taken.
✗ Branch 388 not taken.
✗ Branch 390 not taken.
✗ Branch 391 not taken.
✗ Branch 393 not taken.
✗ Branch 394 not taken.
✗ Branch 396 not taken.
✗ Branch 397 not taken.
✓ Branch 399 taken 722 times.
✗ Branch 400 not taken.
✗ Branch 402 not taken.
✗ Branch 403 not taken.
✗ Branch 405 not taken.
✗ Branch 406 not taken.
✗ Branch 408 not taken.
✗ Branch 409 not taken.
✗ Branch 411 not taken.
✗ Branch 412 not taken.
✗ Branch 414 not taken.
✗ Branch 415 not taken.
✗ Branch 417 not taken.
✗ Branch 418 not taken.
✗ Branch 420 not taken.
✗ Branch 421 not taken.
5676550 template<typename T> inline T zeroVal() { return T(0); }
71 /// Return the @c std::string value that corresponds to zero.
72
19/132
✓ Branch 1 taken 5 times.
✓ Branch 2 taken 7 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 103 times.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✓ Branch 28 taken 90 times.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✓ Branch 31 taken 90 times.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✓ Branch 98 taken 2 times.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✓ Branch 102 taken 1 times.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✓ Branch 111 taken 182 times.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✓ Branch 114 taken 1 times.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✓ Branch 118 taken 438 times.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✓ Branch 121 taken 256 times.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✓ Branch 127 taken 180 times.
✗ Branch 128 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✓ Branch 136 taken 12 times.
✗ Branch 137 not taken.
✓ Branch 139 taken 12 times.
✗ Branch 140 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
1286 template<> inline std::string zeroVal<std::string>() { return ""; }
73 /// Return the @c bool value that corresponds to zero.
74 template<> inline bool zeroVal<bool>() { return false; }
75
76 namespace math {
77
78 /// @todo These won't be needed if we eliminate StringGrids.
79 //@{
80 /// @brief Needed to support the <tt>(zeroVal<ValueType>() + val)</tt> idiom
81 /// when @c ValueType is @c std::string
82 inline std::string operator+(const std::string& s, bool) { return s; }
83 inline std::string operator+(const std::string& s, int) { return s; }
84 inline std::string operator+(const std::string& s, float) { return s; }
85 inline std::string operator+(const std::string& s, double) { return s; }
86 //@}
87
88 /// @brief Componentwise adder for POD types.
89 template<typename Type1, typename Type2>
90 inline auto cwiseAdd(const Type1& v, const Type2 s)
91 {
92 OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
93 2 return v + s;
94 OPENVDB_NO_TYPE_CONVERSION_WARNING_END
95 }
96
97 /// @brief Componentwise less than for POD types.
98 template<typename Type1, typename Type2>
99 inline bool cwiseLessThan(const Type1& a, const Type2& b)
100 {
101 OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
102
9/117
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 4 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 30 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✓ Branch 28 taken 518 times.
✗ Branch 29 not taken.
✓ Branch 30 taken 420738 times.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✓ Branch 46 taken 1 times.
✓ Branch 47 taken 2 times.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
421310 return a < b;
103 OPENVDB_NO_TYPE_CONVERSION_WARNING_END
104 }
105
106 /// @brief Componentwise greater than for POD types.
107 template<typename Type1, typename Type2>
108 inline bool cwiseGreaterThan(const Type1& a, const Type2& b)
109 {
110 OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN
111
55/135
✓ Branch 0 taken 1533 times.
✓ Branch 1 taken 2 times.
✓ Branch 2 taken 1 times.
✓ Branch 3 taken 2 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 4 times.
✓ Branch 8 taken 1 times.
✓ Branch 9 taken 8192 times.
✓ Branch 10 taken 30 times.
✓ Branch 11 taken 65536 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 2 times.
✓ Branch 16 taken 1 times.
✓ Branch 17 taken 101 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
✓ Branch 20 taken 1 times.
✓ Branch 21 taken 1023 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 273 times.
✓ Branch 24 taken 1 times.
✓ Branch 25 taken 1 times.
✓ Branch 26 taken 52532 times.
✓ Branch 27 taken 104283 times.
✓ Branch 28 taken 177473 times.
✓ Branch 29 taken 99 times.
✓ Branch 30 taken 1604154 times.
✓ Branch 31 taken 104283 times.
✓ Branch 32 taken 1033990 times.
✓ Branch 33 taken 1 times.
✓ Branch 34 taken 1103931 times.
✓ Branch 35 taken 4151 times.
✓ Branch 36 taken 1087225 times.
✓ Branch 37 taken 1 times.
✓ Branch 38 taken 1459961 times.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✓ Branch 41 taken 1 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 1 times.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✓ Branch 47 taken 3 times.
✓ Branch 48 taken 1 times.
✗ Branch 49 not taken.
✓ Branch 50 taken 1 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 1 times.
✗ Branch 53 not taken.
✓ Branch 54 taken 1 times.
✗ Branch 55 not taken.
✓ Branch 56 taken 1 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 1 times.
✗ Branch 59 not taken.
✓ Branch 60 taken 1 times.
✗ Branch 61 not taken.
✓ Branch 62 taken 1 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 1 times.
✗ Branch 65 not taken.
✓ Branch 66 taken 1 times.
✗ Branch 67 not taken.
✓ Branch 68 taken 1 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 1 times.
✗ Branch 71 not taken.
✓ Branch 72 taken 1 times.
✗ Branch 73 not taken.
✓ Branch 74 taken 1 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 1 times.
✗ Branch 77 not taken.
✓ Branch 78 taken 1 times.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✓ Branch 125 taken 65520 times.
✗ Branch 126 not taken.
✓ Branch 127 taken 130081770 times.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
136956259 return a > b;
112 OPENVDB_NO_TYPE_CONVERSION_WARNING_END
113 }
114
115
116
117 /// @brief Pi constant taken from Boost to match old behaviour
118 /// @note Available in C++20
119 template <typename T> inline constexpr T pi() { return 3.141592653589793238462643383279502884e+00; }
120 template <> inline constexpr float pi() { return 3.141592653589793238462643383279502884e+00F; }
121 template <> inline constexpr double pi() { return 3.141592653589793238462643383279502884e+00; }
122 template <> inline constexpr long double pi() { return 3.141592653589793238462643383279502884e+00L; }
123
124
125 /// @brief Return the unary negation of the given value.
126 /// @note A negative<T>() specialization must be defined for each ValueType T
127 /// for which unary negation is not defined.
128 template<typename T> inline T negative(const T& val)
129 {
130 // disable unary minus on unsigned warning
131 #if defined(_MSC_VER)
132 #pragma warning(push)
133 #pragma warning(disable:4146)
134 #endif
135
17/146
✓ Branch 0 taken 4032 times.
✓ Branch 1 taken 1 times.
✓ Branch 2 taken 17000 times.
✓ Branch 3 taken 6224 times.
✓ Branch 4 taken 2065 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 4145 times.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2179 times.
✓ Branch 9 taken 3 times.
✓ Branch 10 taken 2252 times.
✓ Branch 11 taken 18 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 98770 times.
✓ Branch 15 taken 214065 times.
✓ Branch 16 taken 85 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✓ Branch 21 taken 6 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 36 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✓ Branch 83 taken 1 times.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
1631131 return T(-val);
136 #if defined(_MSC_VER)
137 #pragma warning(pop)
138 #endif
139 }
140 /// Return the negation of the given boolean.
141 template<> inline bool negative(const bool& val) { return !val; }
142 /// Return the "negation" of the given string.
143
1/24
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
1 template<> inline std::string negative(const std::string& val) { return val; }
144
145
146 //@{
147 /// Tolerance for floating-point comparison
148 template<typename T> struct Tolerance { static T value() { return zeroVal<T>(); } };
149 template<> struct Tolerance<float> { static float value() { return 1e-8f; } };
150 template<> struct Tolerance<double> { static double value() { return 1e-15; } };
151 //@}
152
153 //@{
154 /// Delta for small floating-point offsets
155 template<typename T> struct Delta { static T value() { return zeroVal<T>(); } };
156 template<> struct Delta<float> { static float value() { return 1e-5f; } };
157 template<> struct Delta<double> { static double value() { return 1e-9; } };
158 //@}
159
160
161 // ==========> Random Values <==================
162
163 /// @brief Simple generator of random numbers over the range [0, 1)
164 /// @details Thread-safe as long as each thread has its own Rand01 instance
165 template<typename FloatType = double, typename EngineType = std::mt19937>
166 class Rand01
167 {
168 private:
169 EngineType mEngine;
170 std::uniform_real_distribution<FloatType> mRand;
171
172 public:
173 using ValueType = FloatType;
174
175 /// @brief Initialize the generator.
176 /// @param engine random number generator
177
4/8
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 11 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
14 Rand01(const EngineType& engine): mEngine(engine) {}
178
179 /// @brief Initialize the generator.
180 /// @param seed seed value for the random number generator
181 68 Rand01(unsigned int seed): mEngine(static_cast<typename EngineType::result_type>(seed)) {}
182
183 /// Set the seed value for the random number generator
184 void setSeed(unsigned int seed)
185 {
186 mEngine.seed(static_cast<typename EngineType::result_type>(seed));
187 }
188
189 /// Return a const reference to the random number generator.
190 const EngineType& engine() const { return mEngine; }
191
192 /// Return a uniformly distributed random number in the range [0, 1).
193 14938625 FloatType operator()() { return mRand(mEngine); }
194 };
195
196 using Random01 = Rand01<double, std::mt19937>;
197
198
199 /// @brief Simple random integer generator
200 /// @details Thread-safe as long as each thread has its own RandInt instance
201 template<typename IntType = int, typename EngineType = std::mt19937>
202 class RandInt
203 {
204 private:
205 using Distr = std::uniform_int_distribution<IntType>;
206 EngineType mEngine;
207 Distr mRand;
208
209 public:
210 /// @brief Initialize the generator.
211 /// @param engine random number generator
212 /// @param imin,imax generate integers that are uniformly distributed over [imin, imax]
213 11 RandInt(const EngineType& engine, IntType imin, IntType imax):
214 mEngine(engine),
215
1/2
✓ Branch 0 taken 11 times.
✗ Branch 1 not taken.
22 mRand(std::min(imin, imax), std::max(imin, imax))
216 {}
217
218 /// @brief Initialize the generator.
219 /// @param seed seed value for the random number generator
220 /// @param imin,imax generate integers that are uniformly distributed over [imin, imax]
221 4 RandInt(unsigned int seed, IntType imin, IntType imax):
222 mEngine(static_cast<typename EngineType::result_type>(seed)),
223
27/47
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
✓ Branch 8 taken 1 times.
✓ Branch 9 taken 1 times.
✓ Branch 10 taken 1 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 times.
✓ Branch 13 taken 1 times.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
✓ Branch 21 taken 1 times.
✗ Branch 22 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 1 times.
✓ Branch 27 taken 1 times.
✗ Branch 28 not taken.
✗ Branch 30 not taken.
✓ Branch 31 taken 1 times.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✗ Branch 36 not taken.
✓ Branch 37 taken 1 times.
✓ Branch 39 taken 1 times.
✗ Branch 40 not taken.
✗ Branch 42 not taken.
✓ Branch 43 taken 1 times.
✓ Branch 45 taken 1 times.
✗ Branch 46 not taken.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✗ Branch 54 not taken.
✓ Branch 55 taken 1 times.
✓ Branch 57 taken 1 times.
✗ Branch 58 not taken.
✗ Branch 60 not taken.
✓ Branch 61 taken 5 times.
✓ Branch 63 taken 5 times.
✗ Branch 64 not taken.
34 mRand(std::min(imin, imax), std::max(imin, imax))
224 {}
225
226 /// Change the range over which integers are distributed to [imin, imax].
227 void setRange(IntType imin, IntType imax)
228 {
229 2 mRand = Distr(std::min(imin, imax), std::max(imin, imax));
230 }
231
232 /// Set the seed value for the random number generator
233 void setSeed(unsigned int seed)
234 {
235 mEngine.seed(static_cast<typename EngineType::result_type>(seed));
236 }
237
238 /// Return a const reference to the random number generator.
239 const EngineType& engine() const { return mEngine; }
240
241 /// Return a randomly-generated integer in the current range.
242 IntType operator()() { return mRand(mEngine); }
243
244 /// @brief Return a randomly-generated integer in the new range [imin, imax],
245 /// without changing the current range.
246
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 100 times.
100 IntType operator()(IntType imin, IntType imax)
247 {
248
1/2
✓ Branch 0 taken 100 times.
✗ Branch 1 not taken.
100 const IntType lo = std::min(imin, imax), hi = std::max(imin, imax);
249 100 return mRand(mEngine, typename Distr::param_type(lo, hi));
250 }
251 };
252
253 using RandomInt = RandInt<int, std::mt19937>;
254
255
256 // ==========> Clamp <==================
257
258 /// Return @a x clamped to [@a min, @a max]
259 template<typename Type>
260 inline Type
261 5964 Clamp(Type x, Type min, Type max)
262 {
263
1/11
✗ Branch 0 not taken.
✓ Branch 1 taken 655949 times.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
658931 assert( !(min>max) );
264
7/60
✓ Branch 0 taken 366400 times.
✓ Branch 1 taken 289549 times.
✓ Branch 2 taken 56932 times.
✓ Branch 3 taken 309468 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
658933 return x > min ? x < max ? x : max : min;
265 }
266
267
268 /// Return @a x clamped to [0, 1]
269 template<typename Type>
270 inline Type
271 Clamp01(Type x) { return x > Type(0) ? x < Type(1) ? x : Type(1) : Type(0); }
272
273
274 /// Return @c true if @a x is outside [0,1]
275 template<typename Type>
276 inline bool
277 ClampTest01(Type &x)
278 {
279 if (x >= Type(0) && x <= Type(1)) return false;
280 x = x < Type(0) ? Type(0) : Type(1);
281 return true;
282 }
283
284 /// @brief Return 0 if @a x < @a 0, 1 if @a x > 1 or else (3 &minus; 2 @a x) @a x&sup2;.
285 template<typename Type>
286 inline Type
287 SmoothUnitStep(Type x)
288 {
289 return x > 0 ? x < 1 ? (3-2*x)*x*x : Type(1) : Type(0);
290 }
291
292 /// @brief Return 0 if @a x < @a min, 1 if @a x > @a max or else (3 &minus; 2 @a t) @a t&sup2;,
293 /// where @a t = (@a x &minus; @a min)/(@a max &minus; @a min).
294 template<typename Type>
295 inline Type
296 SmoothUnitStep(Type x, Type min, Type max)
297 {
298 assert(min < max);
299 return SmoothUnitStep((x-min)/(max-min));
300 }
301
302
303 // ==========> Absolute Value <==================
304
305
306 //@{
307 /// Return the absolute value of the given quantity.
308
1/3
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
492830 inline int32_t Abs(int32_t i) { return std::abs(i); }
309 inline int64_t Abs(int64_t i)
310 {
311 static_assert(sizeof(decltype(std::abs(i))) == sizeof(int64_t),
312 "std::abs(int64) broken");
313 return std::abs(i);
314 }
315 inline float Abs(float x) { return std::fabs(x); }
316
24/250
✓ Branch 0 taken 5861665 times.
✓ Branch 1 taken 369903035 times.
✓ Branch 2 taken 509 times.
✓ Branch 3 taken 3 times.
✓ Branch 4 taken 55 times.
✓ Branch 5 taken 75534891 times.
✓ Branch 6 taken 8 times.
✓ Branch 7 taken 3 times.
✓ Branch 8 taken 8 times.
✓ Branch 9 taken 4 times.
✓ Branch 10 taken 13 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2441734 times.
✓ Branch 13 taken 7166300 times.
✓ Branch 14 taken 9640106 times.
✓ Branch 15 taken 9475644 times.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✓ Branch 20 taken 21779 times.
✗ Branch 21 not taken.
✓ Branch 22 taken 21779 times.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✓ Branch 25 taken 21780 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 1910 times.
✗ Branch 28 not taken.
✓ Branch 29 taken 1910 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 1910 times.
✗ Branch 32 not taken.
✓ Branch 33 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 35 taken 2 times.
✗ Branch 36 not taken.
✓ Branch 37 taken 7 times.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 168 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 171 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 177 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✗ Branch 185 not taken.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✗ Branch 192 not taken.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✗ Branch 195 not taken.
✗ Branch 196 not taken.
✗ Branch 197 not taken.
✗ Branch 198 not taken.
✗ Branch 199 not taken.
✗ Branch 200 not taken.
✗ Branch 201 not taken.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✗ Branch 204 not taken.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✗ Branch 207 not taken.
✗ Branch 208 not taken.
✗ Branch 209 not taken.
✗ Branch 210 not taken.
✗ Branch 211 not taken.
✗ Branch 212 not taken.
✗ Branch 213 not taken.
✗ Branch 214 not taken.
✗ Branch 215 not taken.
✗ Branch 216 not taken.
✗ Branch 217 not taken.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✗ Branch 221 not taken.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 224 not taken.
✗ Branch 225 not taken.
✗ Branch 226 not taken.
✗ Branch 227 not taken.
✗ Branch 228 not taken.
✗ Branch 229 not taken.
✗ Branch 230 not taken.
✗ Branch 231 not taken.
✗ Branch 232 not taken.
✗ Branch 233 not taken.
✗ Branch 234 not taken.
✗ Branch 235 not taken.
✗ Branch 236 not taken.
✗ Branch 237 not taken.
✗ Branch 238 not taken.
✗ Branch 239 not taken.
✗ Branch 240 not taken.
✗ Branch 241 not taken.
✗ Branch 242 not taken.
✗ Branch 243 not taken.
✗ Branch 244 not taken.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✗ Branch 248 not taken.
✗ Branch 249 not taken.
688485135 inline double Abs(double x) { return std::fabs(x); }
317 inline long double Abs(long double x) { return std::fabs(x); }
318 inline uint32_t Abs(uint32_t i) { return i; }
319 inline uint64_t Abs(uint64_t i) { return i; }
320 inline bool Abs(bool b) { return b; }
321 // On systems like macOS and FreeBSD, size_t and uint64_t are different types
322 template <typename T>
323 inline typename std::enable_if<std::is_same<T, size_t>::value, T>::type
324 Abs(T i) { return i; }
325 //@}
326
327
328 ////////////////////////////////////////
329
330
331 // ==========> Value Comparison <==================
332
333
334 /// Return @c true if @a x is exactly equal to zero.
335 template<typename Type>
336 inline bool
337 2 isZero(const Type& x)
338 {
339 OPENVDB_NO_FP_EQUALITY_WARNING_BEGIN
340
9/16
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 1000 times.
✓ Branch 2 taken 1009 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 5 times.
✓ Branch 5 taken 1000 times.
✓ Branch 6 taken 1001 times.
✓ Branch 7 taken 26 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
✓ Branch 15 taken 26 times.
4078 return x == zeroVal<Type>();
341 OPENVDB_NO_FP_EQUALITY_WARNING_END
342 }
343
344
345 /// @brief Return @c true if @a x is equal to zero to within
346 /// the default floating-point comparison tolerance.
347 template<typename Type>
348 inline bool
349 isApproxZero(const Type& x)
350 {
351 const Type tolerance = Type(zeroVal<Type>() + Tolerance<Type>::value());
352
40/1152
✓ Branch 0 taken 24924 times.
✓ Branch 1 taken 24247 times.
✓ Branch 2 taken 5 times.
✓ Branch 3 taken 24919 times.
✓ Branch 4 taken 24921 times.
✓ Branch 5 taken 24242 times.
✓ Branch 6 taken 3 times.
✓ Branch 7 taken 24918 times.
✓ Branch 8 taken 103884 times.
✓ Branch 9 taken 104973 times.
✓ Branch 10 taken 150 times.
✓ Branch 11 taken 103734 times.
✓ Branch 12 taken 103884 times.
✓ Branch 13 taken 104972 times.
✓ Branch 14 taken 150 times.
✓ Branch 15 taken 103734 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 7 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 12 times.
✓ Branch 25 taken 17 times.
✓ Branch 26 taken 12 times.
✓ Branch 27 taken 20 times.
✓ Branch 28 taken 8 times.
✓ Branch 29 taken 4 times.
✗ Branch 30 not taken.
✓ Branch 31 taken 8 times.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✓ Branch 84 taken 98930 times.
✓ Branch 85 taken 122092 times.
✓ Branch 86 taken 2 times.
✓ Branch 87 taken 98928 times.
✓ Branch 88 taken 98930 times.
✓ Branch 89 taken 122092 times.
✓ Branch 90 taken 2 times.
✓ Branch 91 taken 98928 times.
✓ Branch 92 taken 98930 times.
✓ Branch 93 taken 122092 times.
✓ Branch 94 taken 2 times.
✓ Branch 95 taken 98928 times.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✓ Branch 104 taken 98930 times.
✓ Branch 105 taken 122092 times.
✓ Branch 106 taken 98928 times.
✓ Branch 107 taken 2 times.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 168 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 171 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 177 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✗ Branch 185 not taken.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✗ Branch 192 not taken.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✗ Branch 195 not taken.
✗ Branch 196 not taken.
✗ Branch 197 not taken.
✗ Branch 198 not taken.
✗ Branch 199 not taken.
✗ Branch 200 not taken.
✗ Branch 201 not taken.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✗ Branch 204 not taken.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✗ Branch 207 not taken.
✗ Branch 208 not taken.
✗ Branch 209 not taken.
✗ Branch 210 not taken.
✗ Branch 211 not taken.
✗ Branch 212 not taken.
✗ Branch 213 not taken.
✗ Branch 214 not taken.
✗ Branch 215 not taken.
✗ Branch 216 not taken.
✗ Branch 217 not taken.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✗ Branch 221 not taken.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 224 not taken.
✗ Branch 225 not taken.
✗ Branch 226 not taken.
✗ Branch 227 not taken.
✗ Branch 228 not taken.
✗ Branch 229 not taken.
✗ Branch 230 not taken.
✗ Branch 231 not taken.
✗ Branch 232 not taken.
✗ Branch 233 not taken.
✗ Branch 234 not taken.
✗ Branch 235 not taken.
✗ Branch 236 not taken.
✗ Branch 237 not taken.
✗ Branch 238 not taken.
✗ Branch 239 not taken.
✗ Branch 240 not taken.
✗ Branch 241 not taken.
✗ Branch 242 not taken.
✗ Branch 243 not taken.
✗ Branch 244 not taken.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✗ Branch 248 not taken.
✗ Branch 249 not taken.
✗ Branch 250 not taken.
✗ Branch 251 not taken.
✗ Branch 252 not taken.
✗ Branch 253 not taken.
✗ Branch 254 not taken.
✗ Branch 255 not taken.
✗ Branch 256 not taken.
✗ Branch 257 not taken.
✗ Branch 258 not taken.
✗ Branch 259 not taken.
✗ Branch 260 not taken.
✗ Branch 261 not taken.
✗ Branch 262 not taken.
✗ Branch 263 not taken.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 266 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✗ Branch 278 not taken.
✗ Branch 279 not taken.
✗ Branch 280 not taken.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✗ Branch 283 not taken.
✗ Branch 284 not taken.
✗ Branch 285 not taken.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✗ Branch 288 not taken.
✗ Branch 289 not taken.
✗ Branch 290 not taken.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
✗ Branch 293 not taken.
✗ Branch 294 not taken.
✗ Branch 295 not taken.
✗ Branch 296 not taken.
✗ Branch 297 not taken.
✗ Branch 298 not taken.
✗ Branch 299 not taken.
✗ Branch 300 not taken.
✗ Branch 301 not taken.
✗ Branch 302 not taken.
✗ Branch 303 not taken.
✗ Branch 304 not taken.
✗ Branch 305 not taken.
✗ Branch 306 not taken.
✗ Branch 307 not taken.
✗ Branch 308 not taken.
✗ Branch 309 not taken.
✗ Branch 310 not taken.
✗ Branch 311 not taken.
✗ Branch 312 not taken.
✗ Branch 313 not taken.
✗ Branch 314 not taken.
✗ Branch 315 not taken.
✗ Branch 316 not taken.
✗ Branch 317 not taken.
✗ Branch 318 not taken.
✗ Branch 319 not taken.
✗ Branch 320 not taken.
✗ Branch 321 not taken.
✗ Branch 322 not taken.
✗ Branch 323 not taken.
✗ Branch 324 not taken.
✗ Branch 325 not taken.
✗ Branch 326 not taken.
✗ Branch 327 not taken.
✗ Branch 328 not taken.
✗ Branch 329 not taken.
✗ Branch 330 not taken.
✗ Branch 331 not taken.
✗ Branch 332 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 335 not taken.
✗ Branch 336 not taken.
✗ Branch 337 not taken.
✗ Branch 338 not taken.
✗ Branch 339 not taken.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✗ Branch 342 not taken.
✗ Branch 343 not taken.
✗ Branch 344 not taken.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✗ Branch 348 not taken.
✗ Branch 349 not taken.
✗ Branch 350 not taken.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✗ Branch 353 not taken.
✗ Branch 354 not taken.
✗ Branch 355 not taken.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✗ Branch 361 not taken.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✗ Branch 364 not taken.
✗ Branch 365 not taken.
✗ Branch 366 not taken.
✗ Branch 367 not taken.
✗ Branch 368 not taken.
✗ Branch 369 not taken.
✗ Branch 370 not taken.
✗ Branch 371 not taken.
✗ Branch 372 not taken.
✗ Branch 373 not taken.
✗ Branch 374 not taken.
✗ Branch 375 not taken.
✗ Branch 376 not taken.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✗ Branch 379 not taken.
✗ Branch 380 not taken.
✗ Branch 381 not taken.
✗ Branch 382 not taken.
✗ Branch 383 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 386 not taken.
✗ Branch 387 not taken.
✗ Branch 388 not taken.
✗ Branch 389 not taken.
✗ Branch 390 not taken.
✗ Branch 391 not taken.
✗ Branch 392 not taken.
✗ Branch 393 not taken.
✗ Branch 394 not taken.
✗ Branch 395 not taken.
✗ Branch 396 not taken.
✗ Branch 397 not taken.
✗ Branch 398 not taken.
✗ Branch 399 not taken.
✗ Branch 400 not taken.
✗ Branch 401 not taken.
✗ Branch 402 not taken.
✗ Branch 403 not taken.
✗ Branch 404 not taken.
✗ Branch 405 not taken.
✗ Branch 406 not taken.
✗ Branch 407 not taken.
✗ Branch 408 not taken.
✗ Branch 409 not taken.
✗ Branch 410 not taken.
✗ Branch 411 not taken.
✗ Branch 412 not taken.
✗ Branch 413 not taken.
✗ Branch 414 not taken.
✗ Branch 415 not taken.
✗ Branch 416 not taken.
✗ Branch 417 not taken.
✗ Branch 418 not taken.
✗ Branch 419 not taken.
✗ Branch 420 not taken.
✗ Branch 421 not taken.
✗ Branch 422 not taken.
✗ Branch 423 not taken.
✗ Branch 424 not taken.
✗ Branch 425 not taken.
✗ Branch 426 not taken.
✗ Branch 427 not taken.
✗ Branch 428 not taken.
✗ Branch 429 not taken.
✗ Branch 430 not taken.
✗ Branch 431 not taken.
✗ Branch 432 not taken.
✗ Branch 433 not taken.
✗ Branch 434 not taken.
✗ Branch 435 not taken.
✗ Branch 436 not taken.
✗ Branch 437 not taken.
✗ Branch 438 not taken.
✗ Branch 439 not taken.
✗ Branch 440 not taken.
✗ Branch 441 not taken.
✗ Branch 442 not taken.
✗ Branch 443 not taken.
✗ Branch 444 not taken.
✗ Branch 445 not taken.
✗ Branch 446 not taken.
✗ Branch 447 not taken.
✗ Branch 448 not taken.
✗ Branch 449 not taken.
✗ Branch 450 not taken.
✗ Branch 451 not taken.
✗ Branch 452 not taken.
✗ Branch 453 not taken.
✗ Branch 454 not taken.
✗ Branch 455 not taken.
✗ Branch 456 not taken.
✗ Branch 457 not taken.
✗ Branch 458 not taken.
✗ Branch 459 not taken.
✗ Branch 460 not taken.
✗ Branch 461 not taken.
✗ Branch 462 not taken.
✗ Branch 463 not taken.
✗ Branch 464 not taken.
✗ Branch 465 not taken.
✗ Branch 466 not taken.
✗ Branch 467 not taken.
✗ Branch 468 not taken.
✗ Branch 469 not taken.
✗ Branch 470 not taken.
✗ Branch 471 not taken.
✗ Branch 472 not taken.
✗ Branch 473 not taken.
✗ Branch 474 not taken.
✗ Branch 475 not taken.
✗ Branch 476 not taken.
✗ Branch 477 not taken.
✗ Branch 478 not taken.
✗ Branch 479 not taken.
✗ Branch 480 not taken.
✗ Branch 481 not taken.
✗ Branch 482 not taken.
✗ Branch 483 not taken.
✗ Branch 484 not taken.
✗ Branch 485 not taken.
✗ Branch 486 not taken.
✗ Branch 487 not taken.
✗ Branch 488 not taken.
✗ Branch 489 not taken.
✗ Branch 490 not taken.
✗ Branch 491 not taken.
✗ Branch 492 not taken.
✗ Branch 493 not taken.
✗ Branch 494 not taken.
✗ Branch 495 not taken.
✗ Branch 496 not taken.
✗ Branch 497 not taken.
✗ Branch 498 not taken.
✗ Branch 499 not taken.
✗ Branch 500 not taken.
✗ Branch 501 not taken.
✗ Branch 502 not taken.
✗ Branch 503 not taken.
✗ Branch 504 not taken.
✗ Branch 505 not taken.
✗ Branch 506 not taken.
✗ Branch 507 not taken.
✗ Branch 508 not taken.
✗ Branch 509 not taken.
✗ Branch 510 not taken.
✗ Branch 511 not taken.
✗ Branch 512 not taken.
✗ Branch 513 not taken.
✗ Branch 514 not taken.
✗ Branch 515 not taken.
✗ Branch 516 not taken.
✗ Branch 517 not taken.
✗ Branch 518 not taken.
✗ Branch 519 not taken.
✗ Branch 520 not taken.
✗ Branch 521 not taken.
✗ Branch 522 not taken.
✗ Branch 523 not taken.
✗ Branch 524 not taken.
✗ Branch 525 not taken.
✗ Branch 526 not taken.
✗ Branch 527 not taken.
✗ Branch 528 not taken.
✗ Branch 529 not taken.
✗ Branch 530 not taken.
✗ Branch 531 not taken.
✗ Branch 532 not taken.
✗ Branch 533 not taken.
✗ Branch 534 not taken.
✗ Branch 535 not taken.
✗ Branch 536 not taken.
✗ Branch 537 not taken.
✗ Branch 538 not taken.
✗ Branch 539 not taken.
✗ Branch 540 not taken.
✗ Branch 541 not taken.
✗ Branch 542 not taken.
✗ Branch 543 not taken.
✗ Branch 544 not taken.
✗ Branch 545 not taken.
✗ Branch 546 not taken.
✗ Branch 547 not taken.
✗ Branch 548 not taken.
✗ Branch 549 not taken.
✗ Branch 550 not taken.
✗ Branch 551 not taken.
✗ Branch 552 not taken.
✗ Branch 553 not taken.
✗ Branch 554 not taken.
✗ Branch 555 not taken.
✗ Branch 556 not taken.
✗ Branch 557 not taken.
✗ Branch 558 not taken.
✗ Branch 559 not taken.
✗ Branch 560 not taken.
✗ Branch 561 not taken.
✗ Branch 562 not taken.
✗ Branch 563 not taken.
✗ Branch 564 not taken.
✗ Branch 565 not taken.
✗ Branch 566 not taken.
✗ Branch 567 not taken.
✗ Branch 568 not taken.
✗ Branch 569 not taken.
✗ Branch 570 not taken.
✗ Branch 571 not taken.
✗ Branch 572 not taken.
✗ Branch 573 not taken.
✗ Branch 574 not taken.
✗ Branch 575 not taken.
✗ Branch 576 not taken.
✗ Branch 577 not taken.
✗ Branch 578 not taken.
✗ Branch 579 not taken.
✗ Branch 580 not taken.
✗ Branch 581 not taken.
✗ Branch 582 not taken.
✗ Branch 583 not taken.
✗ Branch 584 not taken.
✗ Branch 585 not taken.
✗ Branch 586 not taken.
✗ Branch 587 not taken.
✗ Branch 588 not taken.
✗ Branch 589 not taken.
✗ Branch 590 not taken.
✗ Branch 591 not taken.
✗ Branch 592 not taken.
✗ Branch 593 not taken.
✗ Branch 594 not taken.
✗ Branch 595 not taken.
✗ Branch 596 not taken.
✗ Branch 597 not taken.
✗ Branch 598 not taken.
✗ Branch 599 not taken.
✗ Branch 600 not taken.
✗ Branch 601 not taken.
✗ Branch 602 not taken.
✗ Branch 603 not taken.
✗ Branch 604 not taken.
✗ Branch 605 not taken.
✗ Branch 606 not taken.
✗ Branch 607 not taken.
✗ Branch 608 not taken.
✗ Branch 609 not taken.
✗ Branch 610 not taken.
✗ Branch 611 not taken.
✗ Branch 612 not taken.
✗ Branch 613 not taken.
✗ Branch 614 not taken.
✗ Branch 615 not taken.
✗ Branch 616 not taken.
✗ Branch 617 not taken.
✗ Branch 618 not taken.
✗ Branch 619 not taken.
✗ Branch 620 not taken.
✗ Branch 621 not taken.
✗ Branch 622 not taken.
✗ Branch 623 not taken.
✗ Branch 624 not taken.
✗ Branch 625 not taken.
✗ Branch 626 not taken.
✗ Branch 627 not taken.
✗ Branch 628 not taken.
✗ Branch 629 not taken.
✗ Branch 630 not taken.
✗ Branch 631 not taken.
✗ Branch 632 not taken.
✗ Branch 633 not taken.
✗ Branch 634 not taken.
✗ Branch 635 not taken.
✗ Branch 636 not taken.
✗ Branch 637 not taken.
✗ Branch 638 not taken.
✗ Branch 639 not taken.
✗ Branch 640 not taken.
✗ Branch 641 not taken.
✗ Branch 642 not taken.
✗ Branch 643 not taken.
✗ Branch 644 not taken.
✗ Branch 645 not taken.
✗ Branch 646 not taken.
✗ Branch 647 not taken.
✗ Branch 648 not taken.
✗ Branch 649 not taken.
✗ Branch 650 not taken.
✗ Branch 651 not taken.
✗ Branch 652 not taken.
✗ Branch 653 not taken.
✗ Branch 654 not taken.
✗ Branch 655 not taken.
✗ Branch 656 not taken.
✗ Branch 657 not taken.
✗ Branch 658 not taken.
✗ Branch 659 not taken.
✗ Branch 660 not taken.
✗ Branch 661 not taken.
✗ Branch 662 not taken.
✗ Branch 663 not taken.
✗ Branch 664 not taken.
✗ Branch 665 not taken.
✗ Branch 666 not taken.
✗ Branch 667 not taken.
✗ Branch 668 not taken.
✗ Branch 669 not taken.
✗ Branch 670 not taken.
✗ Branch 671 not taken.
✗ Branch 672 not taken.
✗ Branch 673 not taken.
✗ Branch 674 not taken.
✗ Branch 675 not taken.
✗ Branch 676 not taken.
✗ Branch 677 not taken.
✗ Branch 678 not taken.
✗ Branch 679 not taken.
✗ Branch 680 not taken.
✗ Branch 681 not taken.
✗ Branch 682 not taken.
✗ Branch 683 not taken.
✗ Branch 684 not taken.
✗ Branch 685 not taken.
✗ Branch 686 not taken.
✗ Branch 687 not taken.
✗ Branch 688 not taken.
✗ Branch 689 not taken.
✗ Branch 690 not taken.
✗ Branch 691 not taken.
✗ Branch 692 not taken.
✗ Branch 693 not taken.
✗ Branch 694 not taken.
✗ Branch 695 not taken.
✗ Branch 696 not taken.
✗ Branch 697 not taken.
✗ Branch 698 not taken.
✗ Branch 699 not taken.
✗ Branch 700 not taken.
✗ Branch 701 not taken.
✗ Branch 702 not taken.
✗ Branch 703 not taken.
✗ Branch 704 not taken.
✗ Branch 705 not taken.
✗ Branch 706 not taken.
✗ Branch 707 not taken.
✗ Branch 708 not taken.
✗ Branch 709 not taken.
✗ Branch 710 not taken.
✗ Branch 711 not taken.
✗ Branch 712 not taken.
✗ Branch 713 not taken.
✗ Branch 714 not taken.
✗ Branch 715 not taken.
✗ Branch 716 not taken.
✗ Branch 717 not taken.
✗ Branch 718 not taken.
✗ Branch 719 not taken.
✗ Branch 720 not taken.
✗ Branch 721 not taken.
✗ Branch 722 not taken.
✗ Branch 723 not taken.
✗ Branch 724 not taken.
✗ Branch 725 not taken.
✗ Branch 726 not taken.
✗ Branch 727 not taken.
✗ Branch 728 not taken.
✗ Branch 729 not taken.
✗ Branch 730 not taken.
✗ Branch 731 not taken.
✗ Branch 732 not taken.
✗ Branch 733 not taken.
✗ Branch 734 not taken.
✗ Branch 735 not taken.
✗ Branch 736 not taken.
✗ Branch 737 not taken.
✗ Branch 738 not taken.
✗ Branch 739 not taken.
✗ Branch 740 not taken.
✗ Branch 741 not taken.
✗ Branch 742 not taken.
✗ Branch 743 not taken.
✗ Branch 744 not taken.
✗ Branch 745 not taken.
✗ Branch 746 not taken.
✗ Branch 747 not taken.
✗ Branch 748 not taken.
✗ Branch 749 not taken.
✗ Branch 750 not taken.
✗ Branch 751 not taken.
✗ Branch 752 not taken.
✗ Branch 753 not taken.
✗ Branch 754 not taken.
✗ Branch 755 not taken.
✗ Branch 756 not taken.
✗ Branch 757 not taken.
✗ Branch 758 not taken.
✗ Branch 759 not taken.
✗ Branch 760 not taken.
✗ Branch 761 not taken.
✗ Branch 762 not taken.
✗ Branch 763 not taken.
✗ Branch 764 not taken.
✗ Branch 765 not taken.
✗ Branch 766 not taken.
✗ Branch 767 not taken.
✗ Branch 768 not taken.
✗ Branch 769 not taken.
✗ Branch 770 not taken.
✗ Branch 771 not taken.
✗ Branch 772 not taken.
✗ Branch 773 not taken.
✗ Branch 774 not taken.
✗ Branch 775 not taken.
✗ Branch 776 not taken.
✗ Branch 777 not taken.
✗ Branch 778 not taken.
✗ Branch 779 not taken.
✗ Branch 780 not taken.
✗ Branch 781 not taken.
✗ Branch 782 not taken.
✗ Branch 783 not taken.
✗ Branch 784 not taken.
✗ Branch 785 not taken.
✗ Branch 786 not taken.
✗ Branch 787 not taken.
✗ Branch 788 not taken.
✗ Branch 789 not taken.
✗ Branch 790 not taken.
✗ Branch 791 not taken.
✗ Branch 792 not taken.
✗ Branch 793 not taken.
✗ Branch 794 not taken.
✗ Branch 795 not taken.
✗ Branch 796 not taken.
✗ Branch 797 not taken.
✗ Branch 798 not taken.
✗ Branch 799 not taken.
✗ Branch 800 not taken.
✗ Branch 801 not taken.
✗ Branch 802 not taken.
✗ Branch 803 not taken.
✗ Branch 804 not taken.
✗ Branch 805 not taken.
✗ Branch 806 not taken.
✗ Branch 807 not taken.
✗ Branch 808 not taken.
✗ Branch 809 not taken.
✗ Branch 810 not taken.
✗ Branch 811 not taken.
✗ Branch 812 not taken.
✗ Branch 813 not taken.
✗ Branch 814 not taken.
✗ Branch 815 not taken.
✗ Branch 816 not taken.
✗ Branch 817 not taken.
✗ Branch 818 not taken.
✗ Branch 819 not taken.
✗ Branch 820 not taken.
✗ Branch 821 not taken.
✗ Branch 822 not taken.
✗ Branch 823 not taken.
✗ Branch 824 not taken.
✗ Branch 825 not taken.
✗ Branch 826 not taken.
✗ Branch 827 not taken.
✗ Branch 828 not taken.
✗ Branch 829 not taken.
✗ Branch 830 not taken.
✗ Branch 831 not taken.
✗ Branch 832 not taken.
✗ Branch 833 not taken.
✗ Branch 834 not taken.
✗ Branch 835 not taken.
✗ Branch 836 not taken.
✗ Branch 837 not taken.
✗ Branch 838 not taken.
✗ Branch 839 not taken.
✗ Branch 840 not taken.
✗ Branch 841 not taken.
✗ Branch 842 not taken.
✗ Branch 843 not taken.
✗ Branch 844 not taken.
✗ Branch 845 not taken.
✗ Branch 846 not taken.
✗ Branch 847 not taken.
✗ Branch 848 not taken.
✗ Branch 849 not taken.
✗ Branch 850 not taken.
✗ Branch 851 not taken.
✗ Branch 852 not taken.
✗ Branch 853 not taken.
✗ Branch 854 not taken.
✗ Branch 855 not taken.
✗ Branch 856 not taken.
✗ Branch 857 not taken.
✗ Branch 858 not taken.
✗ Branch 859 not taken.
✗ Branch 860 not taken.
✗ Branch 861 not taken.
✗ Branch 862 not taken.
✗ Branch 863 not taken.
✗ Branch 864 not taken.
✗ Branch 865 not taken.
✗ Branch 866 not taken.
✗ Branch 867 not taken.
✗ Branch 868 not taken.
✗ Branch 869 not taken.
✗ Branch 870 not taken.
✗ Branch 871 not taken.
✗ Branch 872 not taken.
✗ Branch 873 not taken.
✗ Branch 874 not taken.
✗ Branch 875 not taken.
✗ Branch 876 not taken.
✗ Branch 877 not taken.
✗ Branch 878 not taken.
✗ Branch 879 not taken.
✗ Branch 880 not taken.
✗ Branch 881 not taken.
✗ Branch 882 not taken.
✗ Branch 883 not taken.
✗ Branch 884 not taken.
✗ Branch 885 not taken.
✗ Branch 886 not taken.
✗ Branch 887 not taken.
✗ Branch 888 not taken.
✗ Branch 889 not taken.
✗ Branch 890 not taken.
✗ Branch 891 not taken.
✗ Branch 892 not taken.
✗ Branch 893 not taken.
✗ Branch 894 not taken.
✗ Branch 895 not taken.
✗ Branch 896 not taken.
✗ Branch 897 not taken.
✗ Branch 898 not taken.
✗ Branch 899 not taken.
✗ Branch 900 not taken.
✗ Branch 901 not taken.
✗ Branch 902 not taken.
✗ Branch 903 not taken.
✗ Branch 904 not taken.
✗ Branch 905 not taken.
✗ Branch 906 not taken.
✗ Branch 907 not taken.
✗ Branch 908 not taken.
✗ Branch 909 not taken.
✗ Branch 910 not taken.
✗ Branch 911 not taken.
✗ Branch 912 not taken.
✗ Branch 913 not taken.
✗ Branch 914 not taken.
✗ Branch 915 not taken.
✗ Branch 916 not taken.
✗ Branch 917 not taken.
✗ Branch 918 not taken.
✗ Branch 919 not taken.
✗ Branch 920 not taken.
✗ Branch 921 not taken.
✗ Branch 922 not taken.
✗ Branch 923 not taken.
✗ Branch 924 not taken.
✗ Branch 925 not taken.
✗ Branch 926 not taken.
✗ Branch 927 not taken.
✗ Branch 928 not taken.
✗ Branch 929 not taken.
✗ Branch 930 not taken.
✗ Branch 931 not taken.
✗ Branch 932 not taken.
✗ Branch 933 not taken.
✗ Branch 934 not taken.
✗ Branch 935 not taken.
✗ Branch 936 not taken.
✗ Branch 937 not taken.
✗ Branch 938 not taken.
✗ Branch 939 not taken.
✗ Branch 940 not taken.
✗ Branch 941 not taken.
✗ Branch 942 not taken.
✗ Branch 943 not taken.
✗ Branch 944 not taken.
✗ Branch 945 not taken.
✗ Branch 946 not taken.
✗ Branch 947 not taken.
✗ Branch 948 not taken.
✗ Branch 949 not taken.
✗ Branch 950 not taken.
✗ Branch 951 not taken.
✗ Branch 952 not taken.
✗ Branch 953 not taken.
✗ Branch 954 not taken.
✗ Branch 955 not taken.
✗ Branch 956 not taken.
✗ Branch 957 not taken.
✗ Branch 958 not taken.
✗ Branch 959 not taken.
✗ Branch 960 not taken.
✗ Branch 961 not taken.
✗ Branch 962 not taken.
✗ Branch 963 not taken.
✗ Branch 964 not taken.
✗ Branch 965 not taken.
✗ Branch 966 not taken.
✗ Branch 967 not taken.
✗ Branch 968 not taken.
✗ Branch 969 not taken.
✗ Branch 970 not taken.
✗ Branch 971 not taken.
✗ Branch 972 not taken.
✗ Branch 973 not taken.
✗ Branch 974 not taken.
✗ Branch 975 not taken.
✗ Branch 976 not taken.
✗ Branch 977 not taken.
✗ Branch 978 not taken.
✗ Branch 979 not taken.
✗ Branch 980 not taken.
✗ Branch 981 not taken.
✗ Branch 982 not taken.
✗ Branch 983 not taken.
✗ Branch 984 not taken.
✗ Branch 985 not taken.
✗ Branch 986 not taken.
✗ Branch 987 not taken.
✗ Branch 988 not taken.
✗ Branch 989 not taken.
✗ Branch 990 not taken.
✗ Branch 991 not taken.
✗ Branch 992 not taken.
✗ Branch 993 not taken.
✗ Branch 994 not taken.
✗ Branch 995 not taken.
✗ Branch 996 not taken.
✗ Branch 997 not taken.
✗ Branch 998 not taken.
✗ Branch 999 not taken.
✗ Branch 1000 not taken.
✗ Branch 1001 not taken.
✗ Branch 1002 not taken.
✗ Branch 1003 not taken.
✗ Branch 1004 not taken.
✗ Branch 1005 not taken.
✗ Branch 1006 not taken.
✗ Branch 1007 not taken.
✗ Branch 1008 not taken.
✗ Branch 1009 not taken.
✗ Branch 1010 not taken.
✗ Branch 1011 not taken.
✗ Branch 1012 not taken.
✗ Branch 1013 not taken.
✗ Branch 1014 not taken.
✗ Branch 1015 not taken.
✗ Branch 1016 not taken.
✗ Branch 1017 not taken.
✗ Branch 1018 not taken.
✗ Branch 1019 not taken.
✗ Branch 1020 not taken.
✗ Branch 1021 not taken.
✗ Branch 1022 not taken.
✗ Branch 1023 not taken.
✗ Branch 1024 not taken.
✗ Branch 1025 not taken.
✗ Branch 1026 not taken.
✗ Branch 1027 not taken.
✗ Branch 1028 not taken.
✗ Branch 1029 not taken.
✗ Branch 1030 not taken.
✗ Branch 1031 not taken.
✗ Branch 1032 not taken.
✗ Branch 1033 not taken.
✗ Branch 1034 not taken.
✗ Branch 1035 not taken.
✗ Branch 1036 not taken.
✗ Branch 1037 not taken.
✗ Branch 1038 not taken.
✗ Branch 1039 not taken.
✗ Branch 1040 not taken.
✗ Branch 1041 not taken.
✗ Branch 1042 not taken.
✗ Branch 1043 not taken.
✗ Branch 1044 not taken.
✗ Branch 1045 not taken.
✗ Branch 1046 not taken.
✗ Branch 1047 not taken.
✗ Branch 1048 not taken.
✗ Branch 1049 not taken.
✗ Branch 1050 not taken.
✗ Branch 1051 not taken.
✗ Branch 1052 not taken.
✗ Branch 1053 not taken.
✗ Branch 1054 not taken.
✗ Branch 1055 not taken.
✗ Branch 1056 not taken.
✗ Branch 1057 not taken.
✗ Branch 1058 not taken.
✗ Branch 1059 not taken.
✗ Branch 1060 not taken.
✗ Branch 1061 not taken.
✗ Branch 1062 not taken.
✗ Branch 1063 not taken.
✗ Branch 1064 not taken.
✗ Branch 1065 not taken.
✗ Branch 1066 not taken.
✗ Branch 1067 not taken.
✗ Branch 1068 not taken.
✗ Branch 1069 not taken.
✗ Branch 1070 not taken.
✗ Branch 1071 not taken.
✗ Branch 1072 not taken.
✗ Branch 1073 not taken.
✗ Branch 1074 not taken.
✗ Branch 1075 not taken.
✗ Branch 1076 not taken.
✗ Branch 1077 not taken.
✗ Branch 1078 not taken.
✗ Branch 1079 not taken.
✗ Branch 1080 not taken.
✗ Branch 1081 not taken.
✗ Branch 1082 not taken.
✗ Branch 1083 not taken.
✗ Branch 1084 not taken.
✗ Branch 1085 not taken.
✗ Branch 1086 not taken.
✗ Branch 1087 not taken.
✗ Branch 1088 not taken.
✗ Branch 1089 not taken.
✗ Branch 1090 not taken.
✗ Branch 1091 not taken.
✗ Branch 1092 not taken.
✗ Branch 1093 not taken.
✗ Branch 1094 not taken.
✗ Branch 1095 not taken.
✗ Branch 1096 not taken.
✗ Branch 1097 not taken.
✗ Branch 1098 not taken.
✗ Branch 1099 not taken.
✗ Branch 1100 not taken.
✗ Branch 1101 not taken.
✗ Branch 1102 not taken.
✗ Branch 1103 not taken.
✗ Branch 1104 not taken.
✗ Branch 1105 not taken.
✗ Branch 1106 not taken.
✗ Branch 1107 not taken.
✗ Branch 1108 not taken.
✗ Branch 1109 not taken.
✗ Branch 1110 not taken.
✗ Branch 1111 not taken.
✗ Branch 1112 not taken.
✗ Branch 1113 not taken.
✗ Branch 1114 not taken.
✗ Branch 1115 not taken.
✗ Branch 1116 not taken.
✗ Branch 1117 not taken.
✗ Branch 1118 not taken.
✗ Branch 1119 not taken.
✗ Branch 1120 not taken.
✗ Branch 1121 not taken.
✗ Branch 1122 not taken.
✗ Branch 1123 not taken.
✗ Branch 1124 not taken.
✗ Branch 1125 not taken.
✗ Branch 1126 not taken.
✗ Branch 1127 not taken.
✗ Branch 1128 not taken.
✗ Branch 1129 not taken.
✗ Branch 1130 not taken.
✗ Branch 1131 not taken.
✗ Branch 1132 not taken.
✗ Branch 1133 not taken.
✗ Branch 1134 not taken.
✗ Branch 1135 not taken.
✗ Branch 1136 not taken.
✗ Branch 1137 not taken.
✗ Branch 1138 not taken.
✗ Branch 1139 not taken.
✗ Branch 1140 not taken.
✗ Branch 1141 not taken.
✗ Branch 1142 not taken.
✗ Branch 1143 not taken.
✗ Branch 1144 not taken.
✗ Branch 1145 not taken.
✗ Branch 1146 not taken.
✗ Branch 1147 not taken.
✗ Branch 1148 not taken.
✗ Branch 1149 not taken.
✗ Branch 1150 not taken.
✗ Branch 1151 not taken.
1400203 return !(x > tolerance) && !(x < -tolerance);
353 }
354
355 /// Return @c true if @a x is equal to zero to within the given tolerance.
356 template<typename Type>
357 inline bool
358 isApproxZero(const Type& x, const Type& tolerance)
359 {
360
21/480
✓ Branch 0 taken 10 times.
✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 10 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
✓ Branch 12 taken 1 times.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✓ Branch 24 taken 1 times.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✓ Branch 27 taken 1 times.
✓ Branch 28 taken 1 times.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✓ Branch 31 taken 1 times.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✓ Branch 36 taken 1 times.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✓ Branch 39 taken 1 times.
✓ Branch 40 taken 7 times.
✓ Branch 41 taken 1 times.
✗ Branch 42 not taken.
✓ Branch 43 taken 7 times.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✗ Branch 122 not taken.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✗ Branch 154 not taken.
✗ Branch 155 not taken.
✗ Branch 156 not taken.
✗ Branch 157 not taken.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✗ Branch 160 not taken.
✗ Branch 161 not taken.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 168 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✗ Branch 171 not taken.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✗ Branch 176 not taken.
✗ Branch 177 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✗ Branch 185 not taken.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✗ Branch 192 not taken.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✗ Branch 195 not taken.
✗ Branch 196 not taken.
✗ Branch 197 not taken.
✗ Branch 198 not taken.
✗ Branch 199 not taken.
✗ Branch 200 not taken.
✗ Branch 201 not taken.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✗ Branch 204 not taken.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✗ Branch 207 not taken.
✗ Branch 208 not taken.
✗ Branch 209 not taken.
✗ Branch 210 not taken.
✗ Branch 211 not taken.
✗ Branch 212 not taken.
✗ Branch 213 not taken.
✗ Branch 214 not taken.
✗ Branch 215 not taken.
✗ Branch 216 not taken.
✗ Branch 217 not taken.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✗ Branch 220 not taken.
✗ Branch 221 not taken.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✗ Branch 224 not taken.
✗ Branch 225 not taken.
✗ Branch 226 not taken.
✗ Branch 227 not taken.
✗ Branch 228 not taken.
✗ Branch 229 not taken.
✗ Branch 230 not taken.
✗ Branch 231 not taken.
✗ Branch 232 not taken.
✗ Branch 233 not taken.
✗ Branch 234 not taken.
✗ Branch 235 not taken.
✗ Branch 236 not taken.
✗ Branch 237 not taken.
✗ Branch 238 not taken.
✗ Branch 239 not taken.
✗ Branch 240 not taken.
✗ Branch 241 not taken.
✗ Branch 242 not taken.
✗ Branch 243 not taken.
✗ Branch 244 not taken.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✗ Branch 248 not taken.
✗ Branch 249 not taken.
✗ Branch 250 not taken.
✗ Branch 251 not taken.
✗ Branch 252 not taken.
✗ Branch 253 not taken.
✗ Branch 254 not taken.
✗ Branch 255 not taken.
✗ Branch 256 not taken.
✗ Branch 257 not taken.
✗ Branch 258 not taken.
✗ Branch 259 not taken.
✗ Branch 260 not taken.
✗ Branch 261 not taken.
✗ Branch 262 not taken.
✗ Branch 263 not taken.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 266 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✗ Branch 278 not taken.
✗ Branch 279 not taken.
✗ Branch 280 not taken.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✗ Branch 283 not taken.
✗ Branch 284 not taken.
✗ Branch 285 not taken.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✗ Branch 288 not taken.
✗ Branch 289 not taken.
✗ Branch 290 not taken.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
✗ Branch 293 not taken.
✗ Branch 294 not taken.
✗ Branch 295 not taken.
✗ Branch 296 not taken.
✗ Branch 297 not taken.
✗ Branch 298 not taken.
✗ Branch 299 not taken.
✗ Branch 300 not taken.
✗ Branch 301 not taken.
✗ Branch 302 not taken.
✗ Branch 303 not taken.
✗ Branch 304 not taken.
✗ Branch 305 not taken.
✗ Branch 306 not taken.
✗ Branch 307 not taken.
✗ Branch 308 not taken.
✗ Branch 309 not taken.
✗ Branch 310 not taken.
✗ Branch 311 not taken.
✗ Branch 312 not taken.
✗ Branch 313 not taken.
✗ Branch 314 not taken.
✗ Branch 315 not taken.
✗ Branch 316 not taken.
✗ Branch 317 not taken.
✗ Branch 318 not taken.
✗ Branch 319 not taken.
✗ Branch 320 not taken.
✗ Branch 321 not taken.
✗ Branch 322 not taken.
✗ Branch 323 not taken.
✗ Branch 324 not taken.
✗ Branch 325 not taken.
✗ Branch 326 not taken.
✗ Branch 327 not taken.
✗ Branch 328 not taken.
✗ Branch 329 not taken.
✗ Branch 330 not taken.
✗ Branch 331 not taken.
✗ Branch 332 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 335 not taken.
✗ Branch 336 not taken.
✗ Branch 337 not taken.
✗ Branch 338 not taken.
✗ Branch 339 not taken.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✗ Branch 342 not taken.
✗ Branch 343 not taken.
✗ Branch 344 not taken.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✗ Branch 348 not taken.
✗ Branch 349 not taken.
✗ Branch 350 not taken.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✗ Branch 353 not taken.
✗ Branch 354 not taken.
✗ Branch 355 not taken.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✗ Branch 361 not taken.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✗ Branch 364 not taken.
✗ Branch 365 not taken.
✗ Branch 366 not taken.
✗ Branch 367 not taken.
✗ Branch 368 not taken.
✗ Branch 369 not taken.
✗ Branch 370 not taken.
✗ Branch 371 not taken.
✗ Branch 372 not taken.
✗ Branch 373 not taken.
✗ Branch 374 not taken.
✗ Branch 375 not taken.
✗ Branch 376 not taken.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✗ Branch 379 not taken.
✗ Branch 380 not taken.
✗ Branch 381 not taken.
✗ Branch 382 not taken.
✗ Branch 383 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 386 not taken.
✗ Branch 387 not taken.
✗ Branch 388 not taken.
✗ Branch 389 not taken.
✗ Branch 390 not taken.
✗ Branch 391 not taken.
✗ Branch 392 not taken.
✗ Branch 393 not taken.
✗ Branch 394 not taken.
✗ Branch 395 not taken.
✗ Branch 396 not taken.
✗ Branch 397 not taken.
✗ Branch 398 not taken.
✗ Branch 399 not taken.
✗ Branch 400 not taken.
✗ Branch 401 not taken.
✗ Branch 402 not taken.
✗ Branch 403 not taken.
✗ Branch 404 not taken.
✗ Branch 405 not taken.
✗ Branch 406 not taken.
✗ Branch 407 not taken.
✗ Branch 408 not taken.
✗ Branch 409 not taken.
✗ Branch 410 not taken.
✗ Branch 411 not taken.
✗ Branch 412 not taken.
✗ Branch 413 not taken.
✗ Branch 414 not taken.
✗ Branch 415 not taken.
✗ Branch 416 not taken.
✗ Branch 417 not taken.
✗ Branch 418 not taken.
✗ Branch 419 not taken.
✗ Branch 420 not taken.
✗ Branch 421 not taken.
✗ Branch 422 not taken.
✗ Branch 423 not taken.
✗ Branch 424 not taken.
✗ Branch 425 not taken.
✗ Branch 426 not taken.
✗ Branch 427 not taken.
✗ Branch 428 not taken.
✗ Branch 429 not taken.
✗ Branch 430 not taken.
✗ Branch 431 not taken.
✗ Branch 432 not taken.
✗ Branch 433 not taken.
✗ Branch 434 not taken.
✗ Branch 435 not taken.
✗ Branch 436 not taken.
✗ Branch 437 not taken.
✗ Branch 438 not taken.
✗ Branch 439 not taken.
✗ Branch 440 not taken.
✗ Branch 441 not taken.
✗ Branch 442 not taken.
✗ Branch 443 not taken.
✗ Branch 444 not taken.
✗ Branch 445 not taken.
✗ Branch 446 not taken.
✗ Branch 447 not taken.
✗ Branch 448 not taken.
✗ Branch 449 not taken.
✗ Branch 450 not taken.
✗ Branch 451 not taken.
✗ Branch 452 not taken.
✗ Branch 453 not taken.
✗ Branch 454 not taken.
✗ Branch 455 not taken.
✗ Branch 456 not taken.
✗ Branch 457 not taken.
✗ Branch 458 not taken.
✗ Branch 459 not taken.
✗ Branch 460 not taken.
✗ Branch 461 not taken.
✗ Branch 462 not taken.
✗ Branch 463 not taken.
✗ Branch 464 not taken.
✗ Branch 465 not taken.
✗ Branch 466 not taken.
✗ Branch 467 not taken.
✗ Branch 468 not taken.
✗ Branch 469 not taken.
✗ Branch 470 not taken.
✗ Branch 471 not taken.
✗ Branch 472 not taken.
✗ Branch 473 not taken.
✗ Branch 474 not taken.
✗ Branch 475 not taken.
✗ Branch 476 not taken.
✗ Branch 477 not taken.
✗ Branch 478 not taken.
✗ Branch 479 not taken.
33 return !(x > tolerance) && !(x < -tolerance);
361 }
362
363
364 /// Return @c true if @a x is less than zero.
365 template<typename Type>
366 inline bool
367
4/25
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 18 times.
✓ Branch 6 taken 163 times.
✓ Branch 7 taken 704 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 18 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
903 isNegative(const Type& x) { return x < zeroVal<Type>(); }
368
369 // Return false, since bool values are never less than zero.
370 template<> inline bool isNegative<bool>(const bool&) { return false; }
371
372
373 /// Return @c true if @a x is finite.
374 inline bool
375 isFinite(const float x) { return std::isfinite(x); }
376
377 /// Return @c true if @a x is finite.
378 template<typename Type, typename std::enable_if<std::is_arithmetic<Type>::value, int>::type = 0>
379 inline bool
380 isFinite(const Type& x) { return std::isfinite(static_cast<double>(x)); }
381
382
383 /// Return @c true if @a x is an infinity value (either positive infinity or negative infinity).
384 inline bool
385 isInfinite(const float x) { return std::isinf(x); }
386
387 /// Return @c true if @a x is an infinity value (either positive infinity or negative infinity).
388 template<typename Type, typename std::enable_if<std::is_arithmetic<Type>::value, int>::type = 0>
389 inline bool
390 isInfinite(const Type& x) { return std::isinf(static_cast<double>(x)); }
391
392
393 /// Return @c true if @a x is a NaN (Not-A-Number) value.
394 inline bool
395 isNan(const float x) { return std::isnan(x); }
396
397 /// Return @c true if @a x is a NaN (Not-A-Number) value.
398 template<typename Type, typename std::enable_if<std::is_arithmetic<Type>::value, int>::type = 0>
399 inline bool
400 isNan(const Type& x) { return std::isnan(static_cast<double>(x)); }
401
402
403 /// Return @c true if @a a is equal to @a b to within the given tolerance.
404 template<typename Type>
405 inline bool
406
0/2
✗ Branch 0 not taken.
✗ Branch 1 not taken.
377268 isApproxEqual(const Type& a, const Type& b, const Type& tolerance)
407 {
408
180/386
✓ Branch 0 taken 262848 times.
✓ Branch 1 taken 4151 times.
✓ Branch 2 taken 1612 times.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 21076 times.
✓ Branch 5 taken 5901 times.
✓ Branch 6 taken 20961 times.
✓ Branch 7 taken 116 times.
✓ Branch 8 taken 21021 times.
✓ Branch 9 taken 6 times.
✓ Branch 10 taken 53306 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 52602 times.
✓ Branch 13 taken 104281 times.
✓ Branch 14 taken 5456079 times.
✓ Branch 15 taken 1059053 times.
✓ Branch 16 taken 1111492 times.
✓ Branch 17 taken 104285 times.
✓ Branch 18 taken 12354 times.
✓ Branch 19 taken 24576 times.
✓ Branch 20 taken 82 times.
✓ Branch 21 taken 24576 times.
✓ Branch 22 taken 589827 times.
✓ Branch 23 taken 263936 times.
✓ Branch 24 taken 153563 times.
✓ Branch 25 taken 163851 times.
✓ Branch 26 taken 55250 times.
✓ Branch 27 taken 10 times.
✓ Branch 28 taken 55244 times.
✓ Branch 29 taken 1 times.
✓ Branch 30 taken 1427 times.
✓ Branch 31 taken 20 times.
✓ Branch 32 taken 21 times.
✓ Branch 33 taken 3427 times.
✓ Branch 34 taken 6154 times.
✓ Branch 35 taken 3 times.
✓ Branch 36 taken 20 times.
✓ Branch 37 taken 5 times.
✓ Branch 38 taken 23 times.
✓ Branch 39 taken 4 times.
✓ Branch 40 taken 20 times.
✓ Branch 41 taken 1130889 times.
✓ Branch 42 taken 48420 times.
✓ Branch 43 taken 3371979 times.
✓ Branch 44 taken 48420 times.
✓ Branch 45 taken 3323594 times.
✓ Branch 46 taken 39 times.
✓ Branch 47 taken 1033993 times.
✓ Branch 48 taken 191305 times.
✓ Branch 49 taken 1033996 times.
✓ Branch 50 taken 19 times.
✓ Branch 51 taken 1130886 times.
✓ Branch 52 taken 4374 times.
✓ Branch 53 taken 2909260 times.
✓ Branch 54 taken 110 times.
✓ Branch 55 taken 1004276 times.
✓ Branch 56 taken 35 times.
✓ Branch 57 taken 1000075 times.
✓ Branch 58 taken 1913555 times.
✓ Branch 59 taken 1000000 times.
✓ Branch 60 taken 1959482 times.
✓ Branch 61 taken 10732 times.
✓ Branch 62 taken 10748 times.
✓ Branch 63 taken 1913540 times.
✓ Branch 64 taken 5408 times.
✓ Branch 65 taken 214 times.
✓ Branch 66 taken 47 times.
✓ Branch 67 taken 1 times.
✓ Branch 68 taken 32783 times.
✓ Branch 69 taken 52 times.
✓ Branch 70 taken 21 times.
✓ Branch 71 taken 17 times.
✓ Branch 72 taken 1363 times.
✓ Branch 73 taken 72 times.
✓ Branch 74 taken 16 times.
✓ Branch 75 taken 19 times.
✓ Branch 76 taken 24 times.
✓ Branch 77 taken 11 times.
✓ Branch 78 taken 1474122 times.
✓ Branch 79 taken 912385 times.
✓ Branch 80 taken 765638 times.
✓ Branch 81 taken 716677 times.
✓ Branch 82 taken 523606 times.
✓ Branch 83 taken 242037 times.
✓ Branch 84 taken 509779 times.
✓ Branch 85 taken 13849 times.
✓ Branch 86 taken 416469 times.
✓ Branch 87 taken 158866 times.
✓ Branch 88 taken 326626 times.
✓ Branch 89 taken 89865 times.
✓ Branch 90 taken 326625 times.
✓ Branch 91 taken 2 times.
✓ Branch 92 taken 327448 times.
✓ Branch 93 taken 8 times.
✓ Branch 94 taken 36 times.
✓ Branch 95 taken 327401 times.
✓ Branch 96 taken 166 times.
✓ Branch 97 taken 8209 times.
✓ Branch 98 taken 162 times.
✓ Branch 99 taken 65557 times.
✓ Branch 100 taken 19881 times.
✓ Branch 101 taken 2049 times.
✓ Branch 102 taken 26 times.
✓ Branch 103 taken 1912 times.
✓ Branch 104 taken 19 times.
✓ Branch 105 taken 4100 times.
✓ Branch 106 taken 19 times.
✓ Branch 107 taken 32769 times.
✓ Branch 108 taken 16 times.
✓ Branch 109 taken 1 times.
✓ Branch 110 taken 65 times.
✓ Branch 111 taken 1 times.
✓ Branch 112 taken 16 times.
✓ Branch 113 taken 49 times.
✗ Branch 114 not taken.
✓ Branch 115 taken 1 times.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✓ Branch 122 taken 49 times.
✗ Branch 123 not taken.
✓ Branch 124 taken 3330845 times.
✓ Branch 125 taken 50 times.
✓ Branch 126 taken 3326941 times.
✓ Branch 127 taken 3904 times.
✓ Branch 128 taken 3326941 times.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✓ Branch 132 taken 5 times.
✓ Branch 133 taken 294833 times.
✓ Branch 134 taken 224977 times.
✓ Branch 135 taken 652140 times.
✓ Branch 136 taken 5 times.
✓ Branch 137 taken 294881 times.
✓ Branch 138 taken 4 times.
✓ Branch 139 taken 294832 times.
✓ Branch 140 taken 210501 times.
✓ Branch 141 taken 737302 times.
✓ Branch 142 taken 4 times.
✓ Branch 143 taken 331665 times.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✓ Branch 152 taken 2 times.
✓ Branch 153 taken 1021 times.
✓ Branch 154 taken 2 times.
✗ Branch 155 not taken.
✓ Branch 156 taken 2 times.
✓ Branch 157 taken 289 times.
✗ Branch 158 not taken.
✗ Branch 159 not taken.
✓ Branch 160 taken 1 times.
✓ Branch 161 taken 1023 times.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✓ Branch 164 taken 1 times.
✓ Branch 165 taken 510 times.
✗ Branch 166 not taken.
✗ Branch 167 not taken.
✗ Branch 168 not taken.
✗ Branch 169 not taken.
✗ Branch 170 not taken.
✓ Branch 171 taken 99 times.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✗ Branch 174 not taken.
✗ Branch 175 not taken.
✓ Branch 176 taken 360374 times.
✗ Branch 177 not taken.
✗ Branch 178 not taken.
✗ Branch 179 not taken.
✗ Branch 180 not taken.
✗ Branch 181 not taken.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✓ Branch 185 taken 273 times.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✓ Branch 188 taken 1 times.
✓ Branch 189 taken 1 times.
✗ Branch 190 not taken.
✓ Branch 191 taken 398 times.
✓ Branch 192 taken 36855 times.
✗ Branch 193 not taken.
✓ Branch 194 taken 36855 times.
✗ Branch 195 not taken.
✓ Branch 196 taken 36855 times.
✗ Branch 197 not taken.
✗ Branch 198 not taken.
✓ Branch 199 taken 36855 times.
✓ Branch 200 taken 36855 times.
✗ Branch 201 not taken.
✓ Branch 202 taken 36855 times.
✗ Branch 203 not taken.
✓ Branch 204 taken 36855 times.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✓ Branch 207 taken 36855 times.
✓ Branch 208 taken 36855 times.
✗ Branch 209 not taken.
✓ Branch 210 taken 36855 times.
✗ Branch 211 not taken.
✓ Branch 212 taken 36855 times.
✗ Branch 213 not taken.
✗ Branch 214 not taken.
✓ Branch 215 taken 36855 times.
✓ Branch 216 taken 36856 times.
✓ Branch 217 taken 1 times.
✓ Branch 218 taken 36855 times.
✗ Branch 219 not taken.
✓ Branch 220 taken 36855 times.
✗ Branch 221 not taken.
✓ Branch 222 taken 1225719 times.
✗ Branch 223 not taken.
✓ Branch 224 taken 5345271 times.
✗ Branch 225 not taken.
✓ Branch 226 taken 36855 times.
✗ Branch 227 not taken.
✓ Branch 228 taken 36855 times.
✗ Branch 229 not taken.
✓ Branch 230 taken 36855 times.
✗ Branch 231 not taken.
✓ Branch 232 taken 36855 times.
✗ Branch 233 not taken.
✓ Branch 234 taken 49140 times.
✗ Branch 235 not taken.
✓ Branch 236 taken 49140 times.
✗ Branch 237 not taken.
✓ Branch 238 taken 49140 times.
✗ Branch 239 not taken.
✓ Branch 240 taken 49140 times.
✗ Branch 241 not taken.
✓ Branch 242 taken 49140 times.
✗ Branch 243 not taken.
✓ Branch 244 taken 49140 times.
✗ Branch 245 not taken.
✓ Branch 246 taken 32760 times.
✗ Branch 247 not taken.
✓ Branch 248 taken 65520 times.
✗ Branch 249 not taken.
✓ Branch 250 taken 65520 times.
✗ Branch 251 not taken.
✓ Branch 252 taken 130081770 times.
✗ Branch 253 not taken.
✓ Branch 254 taken 114660 times.
✗ Branch 255 not taken.
✗ Branch 256 not taken.
✗ Branch 257 not taken.
✗ Branch 258 not taken.
✗ Branch 259 not taken.
✗ Branch 260 not taken.
✗ Branch 261 not taken.
✗ Branch 262 not taken.
✗ Branch 263 not taken.
✗ Branch 264 not taken.
✗ Branch 265 not taken.
✗ Branch 266 not taken.
✗ Branch 267 not taken.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✗ Branch 278 not taken.
✗ Branch 279 not taken.
✗ Branch 280 not taken.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✗ Branch 283 not taken.
✗ Branch 284 not taken.
✗ Branch 285 not taken.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✗ Branch 288 not taken.
✗ Branch 289 not taken.
✗ Branch 290 not taken.
✗ Branch 291 not taken.
✗ Branch 292 not taken.
✗ Branch 293 not taken.
✗ Branch 294 not taken.
✗ Branch 295 not taken.
✗ Branch 296 not taken.
✗ Branch 297 not taken.
✗ Branch 298 not taken.
✗ Branch 299 not taken.
✗ Branch 300 not taken.
✗ Branch 301 not taken.
✗ Branch 302 not taken.
✗ Branch 303 not taken.
✗ Branch 304 not taken.
✗ Branch 305 not taken.
✗ Branch 306 not taken.
✗ Branch 307 not taken.
✗ Branch 308 not taken.
✗ Branch 309 not taken.
✗ Branch 310 not taken.
✗ Branch 311 not taken.
✗ Branch 312 not taken.
✗ Branch 313 not taken.
✗ Branch 314 not taken.
✗ Branch 315 not taken.
✗ Branch 316 not taken.
✗ Branch 317 not taken.
✗ Branch 318 not taken.
✗ Branch 319 not taken.
✗ Branch 320 not taken.
✗ Branch 321 not taken.
✗ Branch 322 not taken.
✗ Branch 323 not taken.
✗ Branch 324 not taken.
✗ Branch 325 not taken.
✗ Branch 326 not taken.
✗ Branch 327 not taken.
✗ Branch 328 not taken.
✗ Branch 329 not taken.
✗ Branch 330 not taken.
✗ Branch 331 not taken.
✗ Branch 332 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 335 not taken.
✗ Branch 336 not taken.
✗ Branch 337 not taken.
✗ Branch 338 not taken.
✗ Branch 339 not taken.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✗ Branch 342 not taken.
✗ Branch 343 not taken.
✗ Branch 344 not taken.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✗ Branch 348 not taken.
✗ Branch 349 not taken.
✗ Branch 350 not taken.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✗ Branch 353 not taken.
✗ Branch 354 not taken.
✗ Branch 355 not taken.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✗ Branch 361 not taken.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✗ Branch 364 not taken.
✗ Branch 365 not taken.
✗ Branch 366 not taken.
✗ Branch 367 not taken.
✗ Branch 368 not taken.
✗ Branch 369 not taken.
✗ Branch 370 not taken.
✗ Branch 371 not taken.
✗ Branch 372 not taken.
✗ Branch 373 not taken.
✗ Branch 374 not taken.
✗ Branch 375 not taken.
✗ Branch 376 not taken.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✗ Branch 379 not taken.
✗ Branch 380 not taken.
✗ Branch 381 not taken.
✗ Branch 383 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 386 not taken.
171978330 return !cwiseGreaterThan(Abs(a - b), tolerance);
409 }
410
411 /// @brief Return @c true if @a a is equal to @a b to within
412 /// the default floating-point comparison tolerance.
413 template<typename Type>
414 inline bool
415 isApproxEqual(const Type& a, const Type& b)
416 {
417 const Type tolerance = Type(zeroVal<Type>() + Tolerance<Type>::value());
418 return isApproxEqual(a, b, tolerance);
419 }
420
421 #define OPENVDB_EXACT_IS_APPROX_EQUAL(T) \
422 template<> inline bool isApproxEqual<T>(const T& a, const T& b) { return a == b; } \
423 template<> inline bool isApproxEqual<T>(const T& a, const T& b, const T&) { return a == b; } \
424 /**/
425
426
8/48
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 49140 times.
✗ Branch 11 not taken.
✓ Branch 12 taken 2 times.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✓ Branch 15 taken 449 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 294836 times.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✓ Branch 26 taken 9 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✓ Branch 32 taken 262080 times.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✓ Branch 44 taken 2097088 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 210 times.
✗ Branch 47 not taken.
2703814 OPENVDB_EXACT_IS_APPROX_EQUAL(bool)
427
2/12
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 45 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 45045 times.
✗ Branch 11 not taken.
45090 OPENVDB_EXACT_IS_APPROX_EQUAL(std::string)
428
429
430 /// @brief Return @c true if @a a is larger than @a b to within
431 /// the given tolerance, i.e., if @a b - @a a < @a tolerance.
432 template<typename Type>
433 inline bool
434 isApproxLarger(const Type& a, const Type& b, const Type& tolerance)
435 {
436
2/4
✗ Branch 0 not taken.
✓ Branch 1 taken 617583 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 8 times.
617591 return (b - a < tolerance);
437 }
438
439
440 /// @brief Return @c true if @a a is exactly equal to @a b.
441 template<typename T0, typename T1>
442 inline bool
443 isExactlyEqual(const T0& a, const T1& b)
444 {
445 OPENVDB_NO_FP_EQUALITY_WARNING_BEGIN
446
249/1266
✓ Branch 0 taken 188779072 times.
✓ Branch 1 taken 6704638 times.
✓ Branch 2 taken 301593060 times.
✓ Branch 3 taken 324080 times.
✓ Branch 4 taken 335131526 times.
✓ Branch 5 taken 49381 times.
✓ Branch 6 taken 335129705 times.
✓ Branch 7 taken 39179 times.
✓ Branch 8 taken 2130 times.
✓ Branch 9 taken 5 times.
✓ Branch 10 taken 2118 times.
✓ Branch 11 taken 2190 times.
✓ Branch 12 taken 275516 times.
✓ Branch 13 taken 6936771 times.
✓ Branch 14 taken 3 times.
✓ Branch 15 taken 273223 times.
✓ Branch 16 taken 4146 times.
✓ Branch 17 taken 13391 times.
✓ Branch 18 taken 2184 times.
✓ Branch 19 taken 2149 times.
✓ Branch 20 taken 3497 times.
✓ Branch 21 taken 1 times.
✓ Branch 22 taken 25999 times.
✓ Branch 23 taken 2145 times.
✓ Branch 24 taken 368579 times.
✓ Branch 25 taken 266035 times.
✓ Branch 26 taken 17437 times.
✓ Branch 27 taken 545137 times.
✓ Branch 28 taken 10 times.
✓ Branch 29 taken 17357 times.
✓ Branch 30 taken 5 times.
✓ Branch 31 taken 57 times.
✓ Branch 32 taken 4 times.
✓ Branch 33 taken 85 times.
✓ Branch 34 taken 3 times.
✓ Branch 35 taken 961 times.
✓ Branch 36 taken 3159 times.
✓ Branch 37 taken 480599 times.
✓ Branch 38 taken 10738 times.
✓ Branch 39 taken 3619 times.
✗ Branch 40 not taken.
✓ Branch 41 taken 116026 times.
✓ Branch 42 taken 6 times.
✓ Branch 43 taken 36 times.
✓ Branch 44 taken 6 times.
✓ Branch 45 taken 28 times.
✓ Branch 46 taken 6 times.
✓ Branch 47 taken 36 times.
✗ Branch 48 not taken.
✓ Branch 49 taken 1 times.
✗ Branch 50 not taken.
✓ Branch 51 taken 1 times.
✗ Branch 52 not taken.
✓ Branch 53 taken 81768 times.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✓ Branch 57 taken 20 times.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✓ Branch 64 taken 335909 times.
✓ Branch 65 taken 24539 times.
✗ Branch 66 not taken.
✓ Branch 67 taken 4718304 times.
✓ Branch 68 taken 144 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 29 times.
✓ Branch 71 taken 4374328 times.
✓ Branch 72 taken 5 times.
✗ Branch 73 not taken.
✓ Branch 74 taken 48 times.
✓ Branch 75 taken 14983830 times.
✓ Branch 76 taken 691 times.
✓ Branch 77 taken 70513990 times.
✓ Branch 78 taken 10 times.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✓ Branch 81 taken 851914 times.
✓ Branch 82 taken 10 times.
✗ Branch 83 not taken.
✓ Branch 84 taken 1698 times.
✓ Branch 85 taken 2105811 times.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✓ Branch 91 taken 3 times.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✓ Branch 95 taken 655320 times.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✓ Branch 99 taken 20 times.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✓ Branch 102 taken 9 times.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✓ Branch 112 taken 380 times.
✗ Branch 113 not taken.
✓ Branch 114 taken 380 times.
✗ Branch 115 not taken.
✓ Branch 116 taken 380 times.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✓ Branch 119 taken 380 times.
✗ Branch 120 not taken.
✗ Branch 121 not taken.
✓ Branch 122 taken 64 times.
✗ Branch 123 not taken.
✗ Branch 124 not taken.
✗ Branch 125 not taken.
✗ Branch 126 not taken.
✗ Branch 127 not taken.
✗ Branch 128 not taken.
✗ Branch 129 not taken.
✗ Branch 130 not taken.
✗ Branch 131 not taken.
✗ Branch 132 not taken.
✗ Branch 133 not taken.
✗ Branch 134 not taken.
✗ Branch 135 not taken.
✗ Branch 136 not taken.
✗ Branch 137 not taken.
✗ Branch 138 not taken.
✗ Branch 139 not taken.
✗ Branch 140 not taken.
✗ Branch 141 not taken.
✗ Branch 142 not taken.
✗ Branch 143 not taken.
✗ Branch 144 not taken.
✗ Branch 145 not taken.
✗ Branch 146 not taken.
✗ Branch 147 not taken.
✗ Branch 148 not taken.
✗ Branch 149 not taken.
✗ Branch 150 not taken.
✗ Branch 151 not taken.
✗ Branch 152 not taken.
✗ Branch 153 not taken.
✓ Branch 154 taken 2 times.
✗ Branch 155 not taken.
✓ Branch 156 taken 2 times.
✗ Branch 157 not taken.
✓ Branch 158 taken 1 times.
✓ Branch 159 taken 246 times.
✗ Branch 160 not taken.
✓ Branch 161 taken 7 times.
✗ Branch 162 not taken.
✗ Branch 163 not taken.
✗ Branch 164 not taken.
✗ Branch 165 not taken.
✓ Branch 166 taken 1 times.
✗ Branch 167 not taken.
✓ Branch 168 taken 1 times.
✓ Branch 169 taken 7 times.
✓ Branch 170 taken 1 times.
✓ Branch 171 taken 4393 times.
✗ Branch 172 not taken.
✗ Branch 173 not taken.
✓ Branch 174 taken 1 times.
✓ Branch 175 taken 19 times.
✗ Branch 176 not taken.
✓ Branch 177 taken 1622 times.
✗ Branch 178 not taken.
✓ Branch 179 taken 1622 times.
✗ Branch 180 not taken.
✓ Branch 181 taken 1622 times.
✗ Branch 182 not taken.
✗ Branch 183 not taken.
✗ Branch 184 not taken.
✗ Branch 185 not taken.
✗ Branch 186 not taken.
✗ Branch 187 not taken.
✗ Branch 188 not taken.
✗ Branch 189 not taken.
✗ Branch 190 not taken.
✗ Branch 191 not taken.
✗ Branch 192 not taken.
✗ Branch 193 not taken.
✗ Branch 194 not taken.
✗ Branch 195 not taken.
✗ Branch 196 not taken.
✓ Branch 197 taken 2 times.
✗ Branch 198 not taken.
✓ Branch 199 taken 2 times.
✓ Branch 200 taken 11 times.
✓ Branch 201 taken 14 times.
✗ Branch 202 not taken.
✗ Branch 203 not taken.
✗ Branch 204 not taken.
✗ Branch 205 not taken.
✗ Branch 206 not taken.
✓ Branch 207 taken 1 times.
✗ Branch 208 not taken.
✗ Branch 209 not taken.
✗ Branch 210 not taken.
✗ Branch 211 not taken.
✗ Branch 212 not taken.
✓ Branch 213 taken 42 times.
✗ Branch 214 not taken.
✓ Branch 215 taken 34 times.
✗ Branch 216 not taken.
✓ Branch 217 taken 1 times.
✗ Branch 218 not taken.
✗ Branch 219 not taken.
✓ Branch 220 taken 8 times.
✓ Branch 221 taken 631362 times.
✗ Branch 222 not taken.
✗ Branch 223 not taken.
✓ Branch 224 taken 8 times.
✓ Branch 225 taken 4876209 times.
✓ Branch 226 taken 40 times.
✓ Branch 227 taken 21139204 times.
✓ Branch 228 taken 11 times.
✓ Branch 229 taken 631359 times.
✗ Branch 230 not taken.
✓ Branch 231 taken 3 times.
✓ Branch 232 taken 13 times.
✓ Branch 233 taken 4876211 times.
✓ Branch 234 taken 40 times.
✓ Branch 235 taken 21139204 times.
✓ Branch 236 taken 8 times.
✓ Branch 237 taken 631360 times.
✗ Branch 238 not taken.
✓ Branch 239 taken 8 times.
✓ Branch 240 taken 8 times.
✓ Branch 241 taken 4876209 times.
✓ Branch 242 taken 40 times.
✓ Branch 243 taken 21139204 times.
✓ Branch 244 taken 1 times.
✗ Branch 245 not taken.
✗ Branch 246 not taken.
✗ Branch 247 not taken.
✓ Branch 248 taken 3 times.
✗ Branch 249 not taken.
✗ Branch 250 not taken.
✗ Branch 251 not taken.
✗ Branch 252 not taken.
✓ Branch 253 taken 734110 times.
✗ Branch 254 not taken.
✗ Branch 255 not taken.
✗ Branch 256 not taken.
✓ Branch 257 taken 5695151 times.
✗ Branch 258 not taken.
✓ Branch 259 taken 19025994 times.
✗ Branch 260 not taken.
✗ Branch 261 not taken.
✓ Branch 262 taken 15 times.
✓ Branch 263 taken 1 times.
✓ Branch 264 taken 15 times.
✓ Branch 265 taken 8 times.
✗ Branch 266 not taken.
✓ Branch 267 taken 2 times.
✗ Branch 268 not taken.
✗ Branch 269 not taken.
✗ Branch 270 not taken.
✗ Branch 271 not taken.
✗ Branch 272 not taken.
✗ Branch 273 not taken.
✗ Branch 274 not taken.
✗ Branch 275 not taken.
✗ Branch 276 not taken.
✗ Branch 277 not taken.
✗ Branch 278 not taken.
✗ Branch 279 not taken.
✓ Branch 280 taken 4 times.
✗ Branch 281 not taken.
✗ Branch 282 not taken.
✗ Branch 283 not taken.
✗ Branch 284 not taken.
✗ Branch 285 not taken.
✗ Branch 286 not taken.
✗ Branch 287 not taken.
✗ Branch 288 not taken.
✗ Branch 289 not taken.
✗ Branch 290 not taken.
✓ Branch 291 taken 8 times.
✗ Branch 292 not taken.
✓ Branch 293 taken 8 times.
✗ Branch 294 not taken.
✓ Branch 295 taken 8 times.
✗ Branch 296 not taken.
✓ Branch 297 taken 8 times.
✗ Branch 298 not taken.
✓ Branch 299 taken 8 times.
✗ Branch 300 not taken.
✓ Branch 301 taken 8 times.
✗ Branch 302 not taken.
✓ Branch 303 taken 8 times.
✗ Branch 304 not taken.
✓ Branch 305 taken 8 times.
✗ Branch 306 not taken.
✓ Branch 307 taken 8 times.
✗ Branch 308 not taken.
✓ Branch 309 taken 8 times.
✗ Branch 310 not taken.
✓ Branch 311 taken 8 times.
✗ Branch 312 not taken.
✓ Branch 313 taken 8 times.
✗ Branch 314 not taken.
✓ Branch 315 taken 8 times.
✗ Branch 316 not taken.
✓ Branch 317 taken 8 times.
✗ Branch 318 not taken.
✓ Branch 319 taken 8 times.
✗ Branch 320 not taken.
✓ Branch 321 taken 8 times.
✗ Branch 322 not taken.
✓ Branch 323 taken 8 times.
✗ Branch 324 not taken.
✓ Branch 325 taken 8 times.
✗ Branch 326 not taken.
✓ Branch 327 taken 8 times.
✗ Branch 328 not taken.
✓ Branch 329 taken 8 times.
✗ Branch 330 not taken.
✓ Branch 331 taken 8 times.
✗ Branch 332 not taken.
✗ Branch 333 not taken.
✗ Branch 334 not taken.
✗ Branch 335 not taken.
✗ Branch 336 not taken.
✗ Branch 337 not taken.
✗ Branch 338 not taken.
✗ Branch 339 not taken.
✗ Branch 340 not taken.
✗ Branch 341 not taken.
✗ Branch 342 not taken.
✗ Branch 343 not taken.
✗ Branch 344 not taken.
✗ Branch 345 not taken.
✗ Branch 346 not taken.
✗ Branch 347 not taken.
✗ Branch 348 not taken.
✗ Branch 349 not taken.
✗ Branch 350 not taken.
✗ Branch 351 not taken.
✗ Branch 352 not taken.
✗ Branch 353 not taken.
✗ Branch 354 not taken.
✗ Branch 355 not taken.
✗ Branch 356 not taken.
✗ Branch 357 not taken.
✗ Branch 358 not taken.
✗ Branch 359 not taken.
✗ Branch 360 not taken.
✗ Branch 361 not taken.
✗ Branch 362 not taken.
✗ Branch 363 not taken.
✗ Branch 364 not taken.
✗ Branch 365 not taken.
✗ Branch 366 not taken.
✗ Branch 367 not taken.
✗ Branch 368 not taken.
✗ Branch 369 not taken.
✗ Branch 370 not taken.
✗ Branch 371 not taken.
✗ Branch 372 not taken.
✗ Branch 373 not taken.
✗ Branch 374 not taken.
✗ Branch 375 not taken.
✗ Branch 376 not taken.
✗ Branch 377 not taken.
✗ Branch 378 not taken.
✗ Branch 379 not taken.
✗ Branch 380 not taken.
✗ Branch 381 not taken.
✗ Branch 382 not taken.
✗ Branch 383 not taken.
✗ Branch 384 not taken.
✗ Branch 385 not taken.
✗ Branch 386 not taken.
✗ Branch 387 not taken.
✗ Branch 388 not taken.
✗ Branch 389 not taken.
✗ Branch 390 not taken.
✗ Branch 391 not taken.
✗ Branch 392 not taken.
✗ Branch 393 not taken.
✗ Branch 394 not taken.
✗ Branch 395 not taken.
✗ Branch 396 not taken.
✗ Branch 397 not taken.
✗ Branch 398 not taken.
✓ Branch 399 taken 1 times.
✗ Branch 400 not taken.
✗ Branch 401 not taken.
✗ Branch 402 not taken.
✗ Branch 403 not taken.
✓ Branch 404 taken 9 times.
✗ Branch 405 not taken.
✗ Branch 406 not taken.
✗ Branch 407 not taken.
✗ Branch 408 not taken.
✗ Branch 409 not taken.
✗ Branch 410 not taken.
✗ Branch 411 not taken.
✗ Branch 412 not taken.
✗ Branch 413 not taken.
✗ Branch 414 not taken.
✗ Branch 415 not taken.
✗ Branch 416 not taken.
✗ Branch 417 not taken.
✗ Branch 418 not taken.
✗ Branch 419 not taken.
✗ Branch 420 not taken.
✗ Branch 421 not taken.
✗ Branch 422 not taken.
✗ Branch 423 not taken.
✗ Branch 424 not taken.
✗ Branch 425 not taken.
✗ Branch 426 not taken.
✗ Branch 427 not taken.
✗ Branch 428 not taken.
✗ Branch 429 not taken.
✗ Branch 430 not taken.
✗ Branch 431 not taken.
✗ Branch 432 not taken.
✗ Branch 433 not taken.
✗ Branch 434 not taken.
✗ Branch 435 not taken.
✗ Branch 436 not taken.
✗ Branch 437 not taken.
✗ Branch 438 not taken.
✗ Branch 439 not taken.
✗ Branch 440 not taken.
✗ Branch 441 not taken.
✗ Branch 442 not taken.
✗ Branch 443 not taken.
✗ Branch 444 not taken.
✗ Branch 445 not taken.
✗ Branch 446 not taken.
✗ Branch 447 not taken.
✗ Branch 448 not taken.
✗ Branch 449 not taken.
✗ Branch 450 not taken.
✗ Branch 451 not taken.
✗ Branch 452 not taken.
✗ Branch 453 not taken.
✗ Branch 454 not taken.
✗ Branch 455 not taken.
✗ Branch 456 not taken.
✗ Branch 457 not taken.
✗ Branch 458 not taken.
✗ Branch 459 not taken.
✗ Branch 460 not taken.
✗ Branch 461 not taken.
✗ Branch 462 not taken.
✗ Branch 463 not taken.
✗ Branch 464 not taken.
✗ Branch 465 not taken.
✗ Branch 466 not taken.
✗ Branch 467 not taken.
✗ Branch 468 not taken.
✗ Branch 469 not taken.
✗ Branch 470 not taken.
✗ Branch 471 not taken.
✗ Branch 472 not taken.
✗ Branch 473 not taken.
✗ Branch 474 not taken.
✗ Branch 475 not taken.
✗ Branch 476 not taken.
✗ Branch 477 not taken.
✗ Branch 478 not taken.
✗ Branch 479 not taken.
✗ Branch 480 not taken.
✗ Branch 481 not taken.
✗ Branch 482 not taken.
✗ Branch 483 not taken.
✗ Branch 484 not taken.
✗ Branch 485 not taken.
✗ Branch 486 not taken.
✗ Branch 487 not taken.
✗ Branch 488 not taken.
✗ Branch 489 not taken.
✗ Branch 490 not taken.
✗ Branch 491 not taken.
✗ Branch 492 not taken.
✗ Branch 493 not taken.
✗ Branch 494 not taken.
✗ Branch 495 not taken.
✗ Branch 496 not taken.
✗ Branch 497 not taken.
✗ Branch 498 not taken.
✗ Branch 499 not taken.
✗ Branch 500 not taken.
✗ Branch 501 not taken.
✗ Branch 502 not taken.
✗ Branch 503 not taken.
✗ Branch 504 not taken.
✗ Branch 505 not taken.
✗ Branch 506 not taken.
✗ Branch 507 not taken.
✗ Branch 508 not taken.
✗ Branch 509 not taken.
✗ Branch 510 not taken.
✗ Branch 511 not taken.
✗ Branch 512 not taken.
✗ Branch 513 not taken.
✗ Branch 514 not taken.
✗ Branch 515 not taken.
✗ Branch 516 not taken.
✗ Branch 517 not taken.
✗ Branch 518 not taken.
✗ Branch 519 not taken.
✗ Branch 520 not taken.
✗ Branch 521 not taken.
✗ Branch 522 not taken.
✗ Branch 523 not taken.
✓ Branch 524 taken 9 times.
✗ Branch 525 not taken.
✗ Branch 526 not taken.
✗ Branch 527 not taken.
✗ Branch 528 not taken.
✗ Branch 529 not taken.
✗ Branch 530 not taken.
✗ Branch 531 not taken.
✗ Branch 532 not taken.
✗ Branch 533 not taken.
✗ Branch 534 not taken.
✗ Branch 535 not taken.
✗ Branch 536 not taken.
✗ Branch 537 not taken.
✗ Branch 538 not taken.
✗ Branch 539 not taken.
✗ Branch 540 not taken.
✗ Branch 541 not taken.
✗ Branch 542 not taken.
✗ Branch 543 not taken.
✗ Branch 544 not taken.
✗ Branch 545 not taken.
✗ Branch 546 not taken.
✗ Branch 547 not taken.
✗ Branch 548 not taken.
✗ Branch 549 not taken.
✗ Branch 550 not taken.
✗ Branch 551 not taken.
✗ Branch 552 not taken.
✗ Branch 553 not taken.
✗ Branch 554 not taken.
✗ Branch 555 not taken.
✗ Branch 556 not taken.
✗ Branch 557 not taken.
✗ Branch 558 not taken.
✗ Branch 559 not taken.
✓ Branch 560 taken 9 times.
✗ Branch 561 not taken.
✗ Branch 562 not taken.
✗ Branch 563 not taken.
✗ Branch 564 not taken.
✗ Branch 565 not taken.
✗ Branch 566 not taken.
✗ Branch 567 not taken.
✗ Branch 568 not taken.
✗ Branch 569 not taken.
✗ Branch 570 not taken.
✗ Branch 571 not taken.
✗ Branch 572 not taken.
✗ Branch 573 not taken.
✗ Branch 574 not taken.
✗ Branch 575 not taken.
✗ Branch 576 not taken.
✗ Branch 577 not taken.
✗ Branch 578 not taken.
✗ Branch 579 not taken.
✗ Branch 580 not taken.
✗ Branch 581 not taken.
✗ Branch 582 not taken.
✗ Branch 583 not taken.
✗ Branch 584 not taken.
✗ Branch 585 not taken.
✗ Branch 586 not taken.
✗ Branch 587 not taken.
✗ Branch 588 not taken.
✗ Branch 589 not taken.
✗ Branch 590 not taken.
✗ Branch 591 not taken.
✗ Branch 592 not taken.
✗ Branch 593 not taken.
✗ Branch 594 not taken.
✗ Branch 595 not taken.
✗ Branch 596 not taken.
✗ Branch 597 not taken.
✗ Branch 598 not taken.
✗ Branch 599 not taken.
✗ Branch 600 not taken.
✗ Branch 601 not taken.
✗ Branch 602 not taken.
✗ Branch 603 not taken.
✗ Branch 604 not taken.
✗ Branch 605 not taken.
✗ Branch 606 not taken.
✗ Branch 607 not taken.
✗ Branch 608 not taken.
✗ Branch 609 not taken.
✗ Branch 610 not taken.
✗ Branch 611 not taken.
✗ Branch 612 not taken.
✗ Branch 613 not taken.
✗ Branch 614 not taken.
✗ Branch 615 not taken.
✗ Branch 616 not taken.
✗ Branch 617 not taken.
✗ Branch 618 not taken.
✗ Branch 619 not taken.
✗ Branch 620 not taken.
✗ Branch 621 not taken.
✗ Branch 622 not taken.
✗ Branch 623 not taken.
✗ Branch 624 not taken.
✗ Branch 625 not taken.
✗ Branch 626 not taken.
✗ Branch 627 not taken.
✗ Branch 628 not taken.
✗ Branch 629 not taken.
✗ Branch 630 not taken.
✗ Branch 631 not taken.
✗ Branch 632 not taken.
✗ Branch 633 not taken.
✗ Branch 634 not taken.
✗ Branch 635 not taken.
✗ Branch 636 not taken.
✗ Branch 637 not taken.
✗ Branch 638 not taken.
✗ Branch 639 not taken.
✗ Branch 640 not taken.
✗ Branch 641 not taken.
✗ Branch 642 not taken.
✗ Branch 643 not taken.
✗ Branch 644 not taken.
✗ Branch 645 not taken.
✗ Branch 646 not taken.
✗ Branch 647 not taken.
✗ Branch 648 not taken.
✗ Branch 649 not taken.
✗ Branch 650 not taken.
✗ Branch 651 not taken.
✗ Branch 652 not taken.
✗ Branch 653 not taken.
✗ Branch 654 not taken.
✗ Branch 655 not taken.
✗ Branch 656 not taken.
✗ Branch 657 not taken.
✗ Branch 658 not taken.
✗ Branch 659 not taken.
✗ Branch 660 not taken.
✗ Branch 661 not taken.
✗ Branch 662 not taken.
✗ Branch 663 not taken.
✗ Branch 664 not taken.
✗ Branch 665 not taken.
✗ Branch 666 not taken.
✗ Branch 667 not taken.
✗ Branch 668 not taken.
✗ Branch 669 not taken.
✗ Branch 670 not taken.
✗ Branch 671 not taken.
✗ Branch 672 not taken.
✗ Branch 673 not taken.
✗ Branch 674 not taken.
✗ Branch 675 not taken.
✗ Branch 676 not taken.
✗ Branch 677 not taken.
✗ Branch 678 not taken.
✗ Branch 679 not taken.
✗ Branch 680 not taken.
✗ Branch 681 not taken.
✗ Branch 682 not taken.
✗ Branch 683 not taken.
✗ Branch 684 not taken.
✗ Branch 685 not taken.
✗ Branch 686 not taken.
✗ Branch 687 not taken.
✗ Branch 688 not taken.
✗ Branch 689 not taken.
✗ Branch 690 not taken.
✗ Branch 691 not taken.
✗ Branch 692 not taken.
✗ Branch 693 not taken.
✗ Branch 694 not taken.
✗ Branch 695 not taken.
✗ Branch 696 not taken.
✗ Branch 697 not taken.
✗ Branch 698 not taken.
✗ Branch 699 not taken.
✗ Branch 700 not taken.
✗ Branch 701 not taken.
✗ Branch 702 not taken.
✗ Branch 703 not taken.
✗ Branch 704 not taken.
✗ Branch 705 not taken.
✗ Branch 706 not taken.
✗ Branch 707 not taken.
✗ Branch 708 not taken.
✗ Branch 709 not taken.
✗ Branch 710 not taken.
✗ Branch 711 not taken.
✗ Branch 712 not taken.
✗ Branch 713 not taken.
✗ Branch 714 not taken.
✗ Branch 715 not taken.
✗ Branch 716 not taken.
✗ Branch 717 not taken.
✗ Branch 718 not taken.
✗ Branch 719 not taken.
✗ Branch 720 not taken.
✗ Branch 721 not taken.
✗ Branch 722 not taken.
✗ Branch 723 not taken.
✗ Branch 724 not taken.
✗ Branch 725 not taken.
✗ Branch 726 not taken.
✗ Branch 727 not taken.
✗ Branch 728 not taken.
✗ Branch 729 not taken.
✗ Branch 730 not taken.
✗ Branch 731 not taken.
✗ Branch 732 not taken.
✗ Branch 733 not taken.
✗ Branch 734 not taken.
✗ Branch 735 not taken.
✗ Branch 736 not taken.
✗ Branch 737 not taken.
✗ Branch 738 not taken.
✗ Branch 739 not taken.
✗ Branch 740 not taken.
✗ Branch 741 not taken.
✗ Branch 742 not taken.
✗ Branch 743 not taken.
✗ Branch 744 not taken.
✗ Branch 745 not taken.
✗ Branch 746 not taken.
✗ Branch 747 not taken.
✗ Branch 748 not taken.
✗ Branch 749 not taken.
✗ Branch 750 not taken.
✗ Branch 751 not taken.
✗ Branch 752 not taken.
✗ Branch 753 not taken.
✗ Branch 754 not taken.
✗ Branch 755 not taken.
✗ Branch 756 not taken.
✗ Branch 757 not taken.
✗ Branch 758 not taken.
✗ Branch 759 not taken.
✗ Branch 760 not taken.
✗ Branch 761 not taken.
✗ Branch 762 not taken.
✗ Branch 763 not taken.
✗ Branch 764 not taken.
✗ Branch 765 not taken.
✗ Branch 766 not taken.
✗ Branch 767 not taken.
✗ Branch 768 not taken.
✗ Branch 769 not taken.
✗ Branch 770 not taken.
✗ Branch 771 not taken.
✗ Branch 772 not taken.
✗ Branch 773 not taken.
✗ Branch 774 not taken.
✗ Branch 775 not taken.
✗ Branch 776 not taken.
✗ Branch 777 not taken.
✗ Branch 778 not taken.
✗ Branch 779 not taken.
✗ Branch 780 not taken.
✗ Branch 781 not taken.
✗ Branch 782 not taken.
✗ Branch 783 not taken.
✗ Branch 784 not taken.
✗ Branch 785 not taken.
✗ Branch 786 not taken.
✗ Branch 787 not taken.
✗ Branch 788 not taken.
✗ Branch 789 not taken.
✗ Branch 790 not taken.
✗ Branch 791 not taken.
✗ Branch 792 not taken.
✗ Branch 793 not taken.
✗ Branch 794 not taken.
✗ Branch 795 not taken.
✗ Branch 796 not taken.
✗ Branch 797 not taken.
✗ Branch 798 not taken.
✗ Branch 799 not taken.
✗ Branch 800 not taken.
✗ Branch 801 not taken.
✗ Branch 802 not taken.
✗ Branch 803 not taken.
✗ Branch 804 not taken.
✗ Branch 805 not taken.
✗ Branch 806 not taken.
✗ Branch 807 not taken.
✗ Branch 808 not taken.
✗ Branch 809 not taken.
✗ Branch 810 not taken.
✗ Branch 811 not taken.
✗ Branch 812 not taken.
✗ Branch 813 not taken.
✗ Branch 814 not taken.
✗ Branch 815 not taken.
✗ Branch 816 not taken.
✗ Branch 817 not taken.
✗ Branch 818 not taken.
✗ Branch 819 not taken.
✗ Branch 820 not taken.
✗ Branch 821 not taken.
✗ Branch 822 not taken.
✗ Branch 823 not taken.
✗ Branch 824 not taken.
✗ Branch 825 not taken.
✗ Branch 826 not taken.
✗ Branch 827 not taken.
✗ Branch 828 not taken.
✗ Branch 829 not taken.
✗ Branch 830 not taken.
✗ Branch 831 not taken.
✗ Branch 832 not taken.
✗ Branch 833 not taken.
✗ Branch 834 not taken.
✗ Branch 835 not taken.
✗ Branch 836 not taken.
✗ Branch 837 not taken.
✗ Branch 838 not taken.
✗ Branch 839 not taken.
✗ Branch 840 not taken.
✗ Branch 841 not taken.
✗ Branch 842 not taken.
✗ Branch 843 not taken.
✗ Branch 844 not taken.
✗ Branch 845 not taken.
✗ Branch 846 not taken.
✗ Branch 847 not taken.
✗ Branch 848 not taken.
✗ Branch 849 not taken.
✗ Branch 850 not taken.
✗ Branch 851 not taken.
✗ Branch 852 not taken.
✗ Branch 853 not taken.
✗ Branch 854 not taken.
✗ Branch 855 not taken.
✗ Branch 856 not taken.
✗ Branch 857 not taken.
✗ Branch 858 not taken.
✗ Branch 859 not taken.
✗ Branch 860 not taken.
✗ Branch 861 not taken.
✗ Branch 862 not taken.
✗ Branch 863 not taken.
✗ Branch 864 not taken.
✗ Branch 865 not taken.
✗ Branch 866 not taken.
✗ Branch 867 not taken.
✗ Branch 868 not taken.
✗ Branch 869 not taken.
✗ Branch 870 not taken.
✗ Branch 871 not taken.
✗ Branch 872 not taken.
✗ Branch 873 not taken.
✗ Branch 875 not taken.
✗ Branch 876 not taken.
✗ Branch 877 not taken.
✗ Branch 878 not taken.
✗ Branch 879 not taken.
✗ Branch 880 not taken.
✗ Branch 883 not taken.
✗ Branch 884 not taken.
✗ Branch 885 not taken.
✗ Branch 886 not taken.
✗ Branch 887 not taken.
✗ Branch 888 not taken.
✗ Branch 889 not taken.
✗ Branch 890 not taken.
✗ Branch 891 not taken.
✗ Branch 892 not taken.
✗ Branch 893 not taken.
✗ Branch 894 not taken.
✗ Branch 895 not taken.
✗ Branch 896 not taken.
✗ Branch 897 not taken.
✗ Branch 898 not taken.
✗ Branch 899 not taken.
✗ Branch 900 not taken.
✗ Branch 901 not taken.
✗ Branch 902 not taken.
✗ Branch 903 not taken.
✗ Branch 904 not taken.
✗ Branch 905 not taken.
✗ Branch 906 not taken.
✗ Branch 907 not taken.
✗ Branch 908 not taken.
✗ Branch 909 not taken.
✗ Branch 910 not taken.
✗ Branch 911 not taken.
✗ Branch 912 not taken.
✗ Branch 913 not taken.
✗ Branch 914 not taken.
✗ Branch 915 not taken.
✗ Branch 916 not taken.
✗ Branch 917 not taken.
✗ Branch 918 not taken.
✗ Branch 919 not taken.
✗ Branch 920 not taken.
✗ Branch 921 not taken.
✗ Branch 922 not taken.
✗ Branch 923 not taken.
✗ Branch 924 not taken.
✗ Branch 925 not taken.
✗ Branch 926 not taken.
✗ Branch 927 not taken.
✗ Branch 928 not taken.
✗ Branch 929 not taken.
✗ Branch 930 not taken.
✗ Branch 931 not taken.
✗ Branch 932 not taken.
✗ Branch 933 not taken.
✗ Branch 934 not taken.
✗ Branch 935 not taken.
✗ Branch 936 not taken.
✗ Branch 937 not taken.
✗ Branch 938 not taken.
✗ Branch 939 not taken.
✗ Branch 940 not taken.
✗ Branch 941 not taken.
✗ Branch 942 not taken.
✗ Branch 943 not taken.
✗ Branch 944 not taken.
✗ Branch 945 not taken.
✗ Branch 946 not taken.
✗ Branch 947 not taken.
✗ Branch 948 not taken.
✗ Branch 949 not taken.
✓ Branch 950 taken 116 times.
✓ Branch 951 taken 76 times.
✓ Branch 952 taken 122 times.
✓ Branch 953 taken 82 times.
✓ Branch 954 taken 120 times.
✓ Branch 955 taken 80 times.
✓ Branch 956 taken 122 times.
✓ Branch 957 taken 82 times.
✓ Branch 958 taken 614364 times.
✓ Branch 959 taken 82 times.
✓ Branch 960 taken 614256 times.
✓ Branch 961 taken 76 times.
✓ Branch 962 taken 122 times.
✓ Branch 963 taken 74 times.
✓ Branch 964 taken 327600 times.
✓ Branch 965 taken 74 times.
✓ Branch 966 taken 122 times.
✓ Branch 967 taken 74 times.
✓ Branch 968 taken 524160 times.
✓ Branch 969 taken 74 times.
✓ Branch 970 taken 350 times.
✓ Branch 971 taken 830 times.
✓ Branch 972 taken 90 times.
✓ Branch 973 taken 44 times.
✓ Branch 974 taken 366 times.
✓ Branch 975 taken 344 times.
✓ Branch 976 taken 210 times.
✓ Branch 977 taken 144 times.
✓ Branch 978 taken 346 times.
✓ Branch 979 taken 258 times.
✓ Branch 980 taken 390 times.
✓ Branch 981 taken 320 times.
✗ Branch 982 not taken.
✗ Branch 983 not taken.
✗ Branch 984 not taken.
✗ Branch 985 not taken.
✗ Branch 986 not taken.
✗ Branch 987 not taken.
✗ Branch 988 not taken.
✗ Branch 989 not taken.
✗ Branch 990 not taken.
✗ Branch 991 not taken.
✗ Branch 992 not taken.
✗ Branch 993 not taken.
✗ Branch 994 not taken.
✗ Branch 995 not taken.
✗ Branch 996 not taken.
✗ Branch 997 not taken.
✗ Branch 998 not taken.
✗ Branch 999 not taken.
✗ Branch 1000 not taken.
✓ Branch 1001 taken 6245352 times.
✗ Branch 1002 not taken.
✓ Branch 1003 taken 6245352 times.
✗ Branch 1004 not taken.
✓ Branch 1005 taken 6245352 times.
✗ Branch 1006 not taken.
✓ Branch 1007 taken 6245352 times.
✗ Branch 1008 not taken.
✓ Branch 1009 taken 6245352 times.
✗ Branch 1010 not taken.
✓ Branch 1011 taken 6245352 times.
✗ Branch 1012 not taken.
✓ Branch 1013 taken 6245352 times.
✗ Branch 1014 not taken.
✓ Branch 1015 taken 6245352 times.
✗ Branch 1016 not taken.
✓ Branch 1017 taken 49176 times.
✗ Branch 1018 not taken.
✓ Branch 1019 taken 49176 times.
✗ Branch 1020 not taken.
✓ Branch 1021 taken 49176 times.
✗ Branch 1022 not taken.
✓ Branch 1023 taken 49176 times.
✗ Branch 1024 not taken.
✓ Branch 1025 taken 49176 times.
✗ Branch 1026 not taken.
✗ Branch 1027 not taken.
✓ Branch 1028 taken 49176 times.
✗ Branch 1029 not taken.
✗ Branch 1030 not taken.
✗ Branch 1031 not taken.
✗ Branch 1032 not taken.
✗ Branch 1033 not taken.
✗ Branch 1034 not taken.
✗ Branch 1035 not taken.
✗ Branch 1036 not taken.
✗ Branch 1037 not taken.
✗ Branch 1038 not taken.
✗ Branch 1039 not taken.
✗ Branch 1040 not taken.
✗ Branch 1041 not taken.
✗ Branch 1042 not taken.
✗ Branch 1043 not taken.
✗ Branch 1044 not taken.
✗ Branch 1045 not taken.
✗ Branch 1046 not taken.
✗ Branch 1047 not taken.
✗ Branch 1048 not taken.
✗ Branch 1049 not taken.
✗ Branch 1050 not taken.
✗ Branch 1051 not taken.
✗ Branch 1052 not taken.
✗ Branch 1053 not taken.
✗ Branch 1054 not taken.
✗ Branch 1055 not taken.
✗ Branch 1056 not taken.
✓ Branch 1057 taken 6245352 times.
✗ Branch 1058 not taken.
✓ Branch 1059 taken 6245352 times.
✗ Branch 1060 not taken.
✓ Branch 1061 taken 6245352 times.
✗ Branch 1062 not taken.
✓ Branch 1063 taken 6245352 times.
✗ Branch 1064 not taken.
✓ Branch 1065 taken 6245352 times.
✗ Branch 1066 not taken.
✓ Branch 1067 taken 6245352 times.
✗ Branch 1068 not taken.
✓ Branch 1069 taken 6245352 times.
✗ Branch 1070 not taken.
✓ Branch 1071 taken 6245352 times.
✗ Branch 1072 not taken.
✓ Branch 1073 taken 49176 times.
✗ Branch 1074 not taken.
✓ Branch 1075 taken 49176 times.
✗ Branch 1076 not taken.
✓ Branch 1077 taken 49176 times.
✗ Branch 1078 not taken.
✓ Branch 1079 taken 49176 times.
✗ Branch 1080 not taken.
✓ Branch 1081 taken 49176 times.
✗ Branch 1082 not taken.
✗ Branch 1083 not taken.
✓ Branch 1084 taken 49176 times.
✗ Branch 1085 not taken.
✗ Branch 1086 not taken.
✗ Branch 1087 not taken.
✗ Branch 1088 not taken.
✗ Branch 1089 not taken.
✗ Branch 1090 not taken.
✗ Branch 1091 not taken.
✗ Branch 1092 not taken.
✗ Branch 1093 not taken.
✗ Branch 1094 not taken.
✗ Branch 1095 not taken.
✗ Branch 1096 not taken.
✗ Branch 1097 not taken.
✗ Branch 1098 not taken.
✗ Branch 1099 not taken.
✗ Branch 1100 not taken.
✗ Branch 1101 not taken.
✗ Branch 1102 not taken.
✗ Branch 1103 not taken.
✗ Branch 1104 not taken.
✗ Branch 1105 not taken.
✗ Branch 1106 not taken.
✗ Branch 1107 not taken.
✗ Branch 1108 not taken.
✗ Branch 1109 not taken.
✗ Branch 1110 not taken.
✗ Branch 1111 not taken.
✗ Branch 1112 not taken.
✗ Branch 1113 not taken.
✗ Branch 1114 not taken.
✗ Branch 1115 not taken.
✗ Branch 1116 not taken.
✗ Branch 1117 not taken.
✗ Branch 1118 not taken.
✗ Branch 1119 not taken.
✗ Branch 1120 not taken.
✓ Branch 1121 taken 6245352 times.
✗ Branch 1122 not taken.
✓ Branch 1123 taken 6245352 times.
✗ Branch 1124 not taken.
✓ Branch 1125 taken 6245352 times.
✗ Branch 1126 not taken.
✓ Branch 1127 taken 6245352 times.
✗ Branch 1128 not taken.
✓ Branch 1129 taken 6245352 times.
✗ Branch 1130 not taken.
✓ Branch 1131 taken 6245352 times.
✗ Branch 1132 not taken.
✓ Branch 1133 taken 6245352 times.
✗ Branch 1134 not taken.
✓ Branch 1135 taken 6245352 times.
✗ Branch 1136 not taken.
✓ Branch 1137 taken 49176 times.
✗ Branch 1138 not taken.
✓ Branch 1139 taken 49176 times.
✗ Branch 1140 not taken.
✓ Branch 1141 taken 49176 times.
✗ Branch 1142 not taken.
✓ Branch 1143 taken 49176 times.
✗ Branch 1144 not taken.
✓ Branch 1145 taken 49176 times.
✗ Branch 1146 not taken.
✗ Branch 1147 not taken.
✓ Branch 1148 taken 49176 times.
✗ Branch 1149 not taken.
✗ Branch 1150 not taken.
✗ Branch 1151 not taken.
✗ Branch 1152 not taken.
✗ Branch 1153 not taken.
✗ Branch 1154 not taken.
✗ Branch 1155 not taken.
✗ Branch 1156 not taken.
✗ Branch 1157 not taken.
✗ Branch 1158 not taken.
✗ Branch 1159 not taken.
✗ Branch 1160 not taken.
✓ Branch 1161 taken 20490 times.
✓ Branch 1162 taken 28686 times.
✓ Branch 1163 taken 4098 times.
✓ Branch 1164 taken 16392 times.
✓ Branch 1165 taken 5 times.
✓ Branch 1166 taken 7 times.
✓ Branch 1167 taken 1 times.
✓ Branch 1168 taken 4 times.
✗ Branch 1169 not taken.
✗ Branch 1170 not taken.
✗ Branch 1171 not taken.
✗ Branch 1172 not taken.
✗ Branch 1173 not taken.
✗ Branch 1174 not taken.
✗ Branch 1175 not taken.
✗ Branch 1176 not taken.
✗ Branch 1177 not taken.
✗ Branch 1178 not taken.
✗ Branch 1179 not taken.
✗ Branch 1180 not taken.
✗ Branch 1181 not taken.
✗ Branch 1182 not taken.
✗ Branch 1183 not taken.
✗ Branch 1184 not taken.
✓ Branch 1185 taken 16392 times.
✓ Branch 1186 taken 32784 times.
✗ Branch 1187 not taken.
✓ Branch 1188 taken 16392 times.
✓ Branch 1189 taken 4 times.
✓ Branch 1190 taken 8 times.
✗ Branch 1191 not taken.
✓ Branch 1192 taken 4 times.
✗ Branch 1193 not taken.
✗ Branch 1194 not taken.
✗ Branch 1195 not taken.
✗ Branch 1196 not taken.
✗ Branch 1197 not taken.
✗ Branch 1198 not taken.
✗ Branch 1199 not taken.
✗ Branch 1200 not taken.
✗ Branch 1201 not taken.
✗ Branch 1202 not taken.
✗ Branch 1203 not taken.
✗ Branch 1204 not taken.
✓ Branch 1205 taken 16392 times.
✓ Branch 1206 taken 32784 times.
✗ Branch 1207 not taken.
✓ Branch 1208 taken 16392 times.
✓ Branch 1209 taken 4 times.
✓ Branch 1210 taken 8 times.
✗ Branch 1211 not taken.
✓ Branch 1212 taken 4 times.
✗ Branch 1213 not taken.
✗ Branch 1214 not taken.
✗ Branch 1215 not taken.
✗ Branch 1216 not taken.
✗ Branch 1217 not taken.
✗ Branch 1218 not taken.
✗ Branch 1219 not taken.
✗ Branch 1220 not taken.
✗ Branch 1221 not taken.
✗ Branch 1222 not taken.
✗ Branch 1223 not taken.
✗ Branch 1224 not taken.
✗ Branch 1225 not taken.
✗ Branch 1226 not taken.
✗ Branch 1227 not taken.
✗ Branch 1228 not taken.
✗ Branch 1229 not taken.
✗ Branch 1230 not taken.
✗ Branch 1231 not taken.
✗ Branch 1232 not taken.
✗ Branch 1233 not taken.
✗ Branch 1234 not taken.
✗ Branch 1235 not taken.
✗ Branch 1236 not taken.
✗ Branch 1237 not taken.
✗ Branch 1238 not taken.
✗ Branch 1239 not taken.
✗ Branch 1240 not taken.
✗ Branch 1241 not taken.
✗ Branch 1242 not taken.
✗ Branch 1243 not taken.
✗ Branch 1244 not taken.
✗ Branch 1245 not taken.
✗ Branch 1246 not taken.
✗ Branch 1247 not taken.
✗ Branch 1248 not taken.
✗ Branch 1249 not taken.
✗ Branch 1250 not taken.
✗ Branch 1251 not taken.
✗ Branch 1252 not taken.
✗ Branch 1253 not taken.
✗ Branch 1254 not taken.
✗ Branch 1255 not taken.
✗ Branch 1256 not taken.
✗ Branch 1257 not taken.
✗ Branch 1258 not taken.
✗ Branch 1259 not taken.
✗ Branch 1260 not taken.
✗ Branch 1261 not taken.
✗ Branch 1262 not taken.
✗ Branch 1263 not taken.
✗ Branch 1264 not taken.
✗ Branch 1265 not taken.
✗ Branch 1266 not taken.
✗ Branch 1267 not taken.
✗ Branch 1268 not taken.
1402579261 return a == b;
447 OPENVDB_NO_FP_EQUALITY_WARNING_END
448 }
449
450
451 template<typename Type>
452 inline bool
453 isRelOrApproxEqual(const Type& a, const Type& b, const Type& absTol, const Type& relTol)
454 {
455 // First check to see if we are inside the absolute tolerance
456 // Necessary for numbers close to 0
457
12/18
✓ Branch 0 taken 28194069 times.
✓ Branch 1 taken 30578401 times.
✓ Branch 2 taken 17995903 times.
✓ Branch 3 taken 11533914 times.
✓ Branch 4 taken 10124640 times.
✓ Branch 5 taken 1409272 times.
✓ Branch 6 taken 158881 times.
✓ Branch 7 taken 1070366 times.
✓ Branch 8 taken 376536 times.
✓ Branch 9 taken 693884 times.
✓ Branch 10 taken 292106 times.
✓ Branch 11 taken 401826 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
60001821 if (!(Abs(a - b) > absTol)) return true;
458
459 // Next check to see if we are inside the relative tolerance
460 // to handle large numbers that aren't within the abs tolerance
461 // but could be the closest floating point representation
462 double relError;
463
12/18
✓ Branch 0 taken 10030678 times.
✓ Branch 1 taken 18163391 times.
✓ Branch 2 taken 6773286 times.
✓ Branch 3 taken 11222617 times.
✓ Branch 4 taken 3304937 times.
✓ Branch 5 taken 6819703 times.
✓ Branch 6 taken 38 times.
✓ Branch 7 taken 158843 times.
✓ Branch 8 taken 168336 times.
✓ Branch 9 taken 208200 times.
✓ Branch 10 taken 128017 times.
✓ Branch 11 taken 164089 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
57142135 if (Abs(b) > Abs(a)) {
464 20405292 relError = Abs((a - b) / b);
465 } else {
466 36736843 relError = Abs((a - b) / a);
467 }
468
9/18
✗ Branch 0 not taken.
✓ Branch 1 taken 28194069 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 17995903 times.
✓ Branch 4 taken 10124640 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 54 times.
✓ Branch 7 taken 158827 times.
✓ Branch 8 taken 48 times.
✓ Branch 9 taken 376488 times.
✓ Branch 10 taken 292070 times.
✓ Branch 11 taken 36 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
57142135 return (relError <= relTol);
469 }
470
471 template<>
472 inline bool
473 isRelOrApproxEqual(const bool& a, const bool& b, const bool&, const bool&)
474 {
475 return (a == b);
476 }
477
478 inline int32_t
479 floatToInt32(const float f)
480 {
481 // switch to std:bit_cast in C++20
482 static_assert(sizeof(int32_t) == sizeof f, "`float` has an unexpected size.");
483 int32_t ret;
484 std::memcpy(&ret, &f, sizeof(int32_t));
485 return ret;
486 }
487
488 inline int64_t
489 doubleToInt64(const double d)
490 {
491 // switch to std:bit_cast in C++20
492 static_assert(sizeof(int64_t) == sizeof d, "`double` has an unexpected size.");
493 int64_t ret;
494 std::memcpy(&ret, &d, sizeof(int64_t));
495 return ret;
496 }
497
498 // aUnitsInLastPlace is the allowed difference between the least significant digits
499 // of the numbers' floating point representation
500 // Please read the reference paper before trying to use isUlpsEqual
501 // http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
502 inline bool
503 isUlpsEqual(const double aLeft, const double aRight, const int64_t aUnitsInLastPlace)
504 {
505 int64_t longLeft = doubleToInt64(aLeft);
506 // Because of 2's complement, must restore lexicographical order
507 if (longLeft < 0) {
508 longLeft = INT64_C(0x8000000000000000) - longLeft;
509 }
510
511 int64_t longRight = doubleToInt64(aRight);
512 // Because of 2's complement, must restore lexicographical order
513 if (longRight < 0) {
514 longRight = INT64_C(0x8000000000000000) - longRight;
515 }
516
517 int64_t difference = Abs(longLeft - longRight);
518 return (difference <= aUnitsInLastPlace);
519 }
520
521 inline bool
522 isUlpsEqual(const float aLeft, const float aRight, const int32_t aUnitsInLastPlace)
523 {
524 int32_t intLeft = floatToInt32(aLeft);
525 // Because of 2's complement, must restore lexicographical order
526 if (intLeft < 0) {
527 intLeft = 0x80000000 - intLeft;
528 }
529
530 int32_t intRight = floatToInt32(aRight);
531 // Because of 2's complement, must restore lexicographical order
532 if (intRight < 0) {
533 intRight = 0x80000000 - intRight;
534 }
535
536 int32_t difference = Abs(intLeft - intRight);
537 return (difference <= aUnitsInLastPlace);
538 }
539
540
541 ////////////////////////////////////////
542
543
544 // ==========> Pow <==================
545
546 /// Return @a x<sup>2</sup>.
547 template<typename Type>
548
50/52
✓ Branch 0 taken 56414571 times.
✓ Branch 1 taken 97176240 times.
✓ Branch 2 taken 1826837 times.
✓ Branch 3 taken 3172854 times.
✓ Branch 4 taken 1864185 times.
✓ Branch 5 taken 2652080 times.
✓ Branch 6 taken 2036248 times.
✓ Branch 7 taken 2986817 times.
✓ Branch 8 taken 1875655 times.
✓ Branch 9 taken 2640663 times.
✓ Branch 10 taken 2301712 times.
✓ Branch 11 taken 3317114 times.
✓ Branch 12 taken 2035854 times.
✓ Branch 13 taken 3168674 times.
✓ Branch 14 taken 2162820 times.
✓ Branch 15 taken 3167277 times.
✓ Branch 16 taken 1984043 times.
✓ Branch 17 taken 3220485 times.
✓ Branch 18 taken 2045412 times.
✓ Branch 19 taken 3191060 times.
✓ Branch 20 taken 1989540 times.
✓ Branch 21 taken 3214988 times.
✓ Branch 22 taken 2062751 times.
✓ Branch 23 taken 3257467 times.
✓ Branch 24 taken 4718475 times.
✓ Branch 25 taken 719041 times.
✓ Branch 26 taken 25846437 times.
✓ Branch 27 taken 661408 times.
✓ Branch 28 taken 559755 times.
✓ Branch 29 taken 719041 times.
✓ Branch 30 taken 812472 times.
✓ Branch 31 taken 748167 times.
✓ Branch 32 taken 559782 times.
✓ Branch 33 taken 719014 times.
✓ Branch 34 taken 620335 times.
✓ Branch 35 taken 658461 times.
✓ Branch 36 taken 272353 times.
✓ Branch 37 taken 295490 times.
✓ Branch 38 taken 285090 times.
✓ Branch 39 taken 282753 times.
✓ Branch 40 taken 272362 times.
✓ Branch 41 taken 295481 times.
✓ Branch 42 taken 285099 times.
✓ Branch 43 taken 282744 times.
✓ Branch 44 taken 272362 times.
✓ Branch 45 taken 295481 times.
✓ Branch 46 taken 285108 times.
✓ Branch 47 taken 282735 times.
✓ Branch 49 taken 7 times.
✗ Branch 50 not taken.
✓ Branch 52 taken 10 times.
✗ Branch 53 not taken.
462549329 inline Type Pow2(Type x) { return x*x; }
549
550 /// Return @a x<sup>3</sup>.
551 template<typename Type>
552
12/22
✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 94441 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 98 times.
✓ Branch 7 taken 47620 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 6168 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 74184 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✓ Branch 19 taken 1 times.
✗ Branch 20 not taken.
✓ Branch 22 taken 1 times.
✗ Branch 23 not taken.
10126071 inline Type Pow3(Type x) { return x*x*x; }
553
554 /// Return @a x<sup>4</sup>.
555 template<typename Type>
556 inline Type Pow4(Type x) { return Pow2(Pow2(x)); }
557
558 /// Return @a x<sup>n</sup>.
559 template<typename Type>
560 Type
561 28 Pow(Type x, int n)
562 {
563 Type ans = 1;
564
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 28 times.
28 if (n < 0) {
565 n = -n;
566 x = Type(1)/x;
567 }
568
2/2
✓ Branch 0 taken 121 times.
✓ Branch 1 taken 28 times.
149 while (n--) ans *= x;
569 28 return ans;
570 }
571
572 //@{
573 /// Return @a b<sup>e</sup>.
574 inline float
575 Pow(float b, float e)
576 {
577 assert( b >= 0.0f && "Pow(float,float): base is negative" );
578 return powf(b,e);
579 }
580
581 inline double
582 133 Pow(double b, double e)
583 {
584
1/2
✗ Branch 0 not taken.
✓ Branch 1 taken 133 times.
133 assert( b >= 0.0 && "Pow(double,double): base is negative" );
585 133 return std::pow(b,e);
586 }
587 //@}
588
589
590 // ==========> Max <==================
591
592 /// Return the maximum of two values
593 template<typename Type>
594 inline const Type&
595 Max(const Type& a, const Type& b)
596 {
597 return std::max(a,b);
598 }
599
600 /// Return the maximum of three values
601 template<typename Type>
602 inline const Type&
603 Max(const Type& a, const Type& b, const Type& c)
604 {
605 return std::max(std::max(a,b), c);
606 }
607
608 /// Return the maximum of four values
609 template<typename Type>
610 inline const Type&
611 Max(const Type& a, const Type& b, const Type& c, const Type& d)
612 {
613 return std::max(std::max(a,b), std::max(c,d));
614 }
615
616 /// Return the maximum of five values
617 template<typename Type>
618 inline const Type&
619 Max(const Type& a, const Type& b, const Type& c, const Type& d, const Type& e)
620 {
621 return std::max(std::max(a,b), Max(c,d,e));
622 }
623
624 /// Return the maximum of six values
625 template<typename Type>
626 inline const Type&
627 Max(const Type& a, const Type& b, const Type& c, const Type& d, const Type& e, const Type& f)
628 {
629 return std::max(Max(a,b,c), Max(d,e,f));
630 }
631
632 /// Return the maximum of seven values
633 template<typename Type>
634 inline const Type&
635 Max(const Type& a, const Type& b, const Type& c, const Type& d,
636 const Type& e, const Type& f, const Type& g)
637 {
638 return std::max(Max(a,b,c,d), Max(e,f,g));
639 }
640
641 /// Return the maximum of eight values
642 template<typename Type>
643 inline const Type&
644 Max(const Type& a, const Type& b, const Type& c, const Type& d,
645 const Type& e, const Type& f, const Type& g, const Type& h)
646 {
647 return std::max(Max(a,b,c,d), Max(e,f,g,h));
648 }
649
650
651 // ==========> Min <==================
652
653 /// Return the minimum of two values
654 template<typename Type>
655 inline const Type&
656 Min(const Type& a, const Type& b) { return std::min(a, b); }
657
658 /// Return the minimum of three values
659 template<typename Type>
660 inline const Type&
661 Min(const Type& a, const Type& b, const Type& c) { return std::min(std::min(a, b), c); }
662
663 /// Return the minimum of four values
664 template<typename Type>
665 inline const Type&
666 Min(const Type& a, const Type& b, const Type& c, const Type& d)
667 {
668 return std::min(std::min(a, b), std::min(c, d));
669 }
670
671 /// Return the minimum of five values
672 template<typename Type>
673 inline const Type&
674 Min(const Type& a, const Type& b, const Type& c, const Type& d, const Type& e)
675 {
676 return std::min(std::min(a,b), Min(c,d,e));
677 }
678
679 /// Return the minimum of six values
680 template<typename Type>
681 inline const Type&
682 Min(const Type& a, const Type& b, const Type& c, const Type& d, const Type& e, const Type& f)
683 {
684 return std::min(Min(a,b,c), Min(d,e,f));
685 }
686
687 /// Return the minimum of seven values
688 template<typename Type>
689 inline const Type&
690 Min(const Type& a, const Type& b, const Type& c, const Type& d,
691 const Type& e, const Type& f, const Type& g)
692 {
693 return std::min(Min(a,b,c,d), Min(e,f,g));
694 }
695
696 /// Return the minimum of eight values
697 template<typename Type>
698 inline const Type&
699 Min(const Type& a, const Type& b, const Type& c, const Type& d,
700 const Type& e, const Type& f, const Type& g, const Type& h)
701 {
702 return std::min(Min(a,b,c,d), Min(e,f,g,h));
703 }
704
705
706 // ============> Exp <==================
707
708 /// Return @a e<sup>x</sup>.
709 template<typename Type>
710 inline Type Exp(const Type& x) { return std::exp(x); }
711
712 // ============> Sin <==================
713
714 //@{
715 /// Return sin @a x.
716 inline float Sin(const float& x) { return std::sin(x); }
717
718
5/6
✓ Branch 0 taken 66424 times.
✓ Branch 1 taken 22292 times.
✓ Branch 2 taken 282894 times.
✓ Branch 3 taken 93480 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
465241 inline double Sin(const double& x) { return std::sin(x); }
719 //@}
720
721 // ============> Cos <==================
722
723 //@{
724 /// Return cos @a x.
725 inline float Cos(const float& x) { return std::cos(x); }
726
727 inline double Cos(const double& x) { return std::cos(x); }
728 //@}
729
730
731 ////////////////////////////////////////
732
733
734 /// Return the sign of the given value as an integer (either -1, 0 or 1).
735 template <typename Type>
736 inline int Sign(const Type &x) { return (zeroVal<Type>() < x) - (x < zeroVal<Type>()); }
737
738
739 /// @brief Return @c true if @a a and @a b have different signs.
740 /// @note Zero is considered a positive number.
741 template <typename Type>
742 inline bool
743 SignChange(const Type& a, const Type& b)
744 {
745 return ( (a<zeroVal<Type>()) ^ (b<zeroVal<Type>()) );
746 }
747
748
749 /// @brief Return @c true if the interval [@a a, @a b] includes zero,
750 /// i.e., if either @a a or @a b is zero or if they have different signs.
751 template <typename Type>
752 inline bool
753 ZeroCrossing(const Type& a, const Type& b)
754 {
755
6/6
✓ Branch 0 taken 205861 times.
✓ Branch 1 taken 779890 times.
✓ Branch 2 taken 207730 times.
✓ Branch 3 taken 203992 times.
✓ Branch 4 taken 8 times.
✓ Branch 5 taken 5 times.
1397486 return a * b <= zeroVal<Type>();
756 }
757
758
759 //@{
760 /// Return the square root of a floating-point value.
761 inline float Sqrt(float x) { return std::sqrt(x); }
762
12/120
✓ Branch 0 taken 119726 times.
✓ Branch 1 taken 18590 times.
✓ Branch 2 taken 339957 times.
✓ Branch 3 taken 84776 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 9030 times.
✓ Branch 7 taken 7143 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✓ Branch 10 taken 28496 times.
✓ Branch 11 taken 14846 times.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✓ Branch 14 taken 6168 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 2784 times.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✓ Branch 22 taken 53858 times.
✓ Branch 23 taken 33595 times.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✗ Branch 59 not taken.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✗ Branch 83 not taken.
✗ Branch 84 not taken.
✗ Branch 85 not taken.
✗ Branch 86 not taken.
✗ Branch 87 not taken.
✗ Branch 88 not taken.
✗ Branch 89 not taken.
✗ Branch 90 not taken.
✗ Branch 91 not taken.
✗ Branch 92 not taken.
✗ Branch 93 not taken.
✗ Branch 94 not taken.
✗ Branch 95 not taken.
✗ Branch 96 not taken.
✗ Branch 97 not taken.
✗ Branch 98 not taken.
✗ Branch 99 not taken.
✗ Branch 100 not taken.
✗ Branch 101 not taken.
✗ Branch 102 not taken.
✗ Branch 103 not taken.
✗ Branch 104 not taken.
✗ Branch 105 not taken.
✗ Branch 106 not taken.
✗ Branch 107 not taken.
✗ Branch 108 not taken.
✗ Branch 109 not taken.
✗ Branch 110 not taken.
✗ Branch 111 not taken.
✗ Branch 112 not taken.
✗ Branch 113 not taken.
✗ Branch 114 not taken.
✗ Branch 115 not taken.
✗ Branch 116 not taken.
✗ Branch 117 not taken.
✗ Branch 118 not taken.
✗ Branch 119 not taken.
4558990 inline double Sqrt(double x) { return std::sqrt(x); }
763 inline long double Sqrt(long double x) { return std::sqrt(x); }
764 //@}
765
766
767 //@{
768 /// Return the cube root of a floating-point value.
769 inline float Cbrt(float x) { return std::cbrt(x); }
770
1/4
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
5 inline double Cbrt(double x) { return std::cbrt(x); }
771 inline long double Cbrt(long double x) { return std::cbrt(x); }
772 //@}
773
774
775 //@{
776 /// Return the remainder of @a x / @a y.
777 inline int Mod(int x, int y) { return (x % y); }
778 inline float Mod(float x, float y) { return std::fmod(x, y); }
779 inline double Mod(double x, double y) { return std::fmod(x, y); }
780 inline long double Mod(long double x, long double y) { return std::fmod(x, y); }
781 template<typename Type> inline Type Remainder(Type x, Type y) { return Mod(x, y); }
782 //@}
783
784
785 //@{
786 /// Return @a x rounded up to the nearest integer.
787 inline float RoundUp(float x) { return std::ceil(x); }
788
12/24
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 20 taken 1 times.
✗ Branch 21 not taken.
✓ Branch 23 taken 5 times.
✗ Branch 24 not taken.
✓ Branch 26 taken 8 times.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✓ Branch 29 taken 1 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 1 times.
✗ Branch 34 not taken.
✓ Branch 35 taken 8 times.
17325050 inline double RoundUp(double x) { return std::ceil(x); }
789 inline long double RoundUp(long double x) { return std::ceil(x); }
790 //@}
791 /// Return @a x rounded up to the nearest multiple of @a base.
792 template<typename Type>
793 inline Type
794 RoundUp(Type x, Type base)
795 {
796 Type remainder = Remainder(x, base);
797 return remainder ? x-remainder+base : x;
798 }
799
800
801 //@{
802 /// Return @a x rounded down to the nearest integer.
803 inline float RoundDown(float x) { return std::floor(x); }
804
13/22
✓ Branch 0 taken 2 times.
✓ Branch 1 taken 33 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 1 times.
✗ Branch 14 not taken.
✓ Branch 15 taken 1 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 1 times.
✗ Branch 18 not taken.
✓ Branch 19 taken 1 times.
✓ Branch 20 taken 2 times.
✓ Branch 21 taken 5 times.
4414853972 inline double RoundDown(double x) { return std::floor(x); }
805 inline long double RoundDown(long double x) { return std::floor(x); }
806 //@}
807 /// Return @a x rounded down to the nearest multiple of @a base.
808 template<typename Type>
809 inline Type
810 RoundDown(Type x, Type base)
811 {
812 Type remainder = Remainder(x, base);
813 return remainder ? x-remainder : x;
814 }
815
816
817 //@{
818 /// Return @a x rounded to the nearest integer.
819
4/30
✓ Branch 0 taken 1 times.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
7 inline float Round(float x) { return RoundDown(x + 0.5f); }
820
3/6
✓ Branch 1 taken 4 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 4 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 1 times.
✗ Branch 8 not taken.
4397646478 inline double Round(double x) { return RoundDown(x + 0.5); }
821 inline long double Round(long double x) { return RoundDown(x + 0.5l); }
822 //@}
823
824
825 /// Return the euclidean remainder of @a x.
826 /// Note unlike % operator this will always return a positive result
827 template<typename Type>
828 inline Type
829 EuclideanRemainder(Type x) { return x - RoundDown(x); }
830
831
832 /// Return the integer part of @a x.
833 template<typename Type>
834 inline Type
835 IntegerPart(Type x)
836 {
837 return (x > 0 ? RoundDown(x) : RoundUp(x));
838 }
839
840 /// Return the fractional part of @a x.
841 template<typename Type>
842 inline Type
843 FractionalPart(Type x) { return Mod(x,Type(1)); }
844
845
846 //@{
847 /// Return the floor of @a x.
848
10/22
✓ Branch 0 taken 9 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✓ Branch 12 taken 1 times.
✗ Branch 13 not taken.
✓ Branch 14 taken 1 times.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✓ Branch 18 taken 1 times.
✗ Branch 19 not taken.
✓ Branch 20 taken 7 times.
✓ Branch 21 taken 1 times.
93707135 inline int Floor(float x) { return int(RoundDown(x)); }
849
1/2
✗ Branch 2 not taken.
✓ Branch 3 taken 84 times.
16554421 inline int Floor(double x) { return int(RoundDown(x)); }
850 inline int Floor(long double x) { return int(RoundDown(x)); }
851 //@}
852
853
854 //@{
855 /// Return the ceiling of @a x.
856 80 inline int Ceil(float x) { return int(RoundUp(x)); }
857
4/84
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✓ Branch 2 taken 34 times.
✓ Branch 3 taken 50 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
✗ Branch 16 not taken.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
✗ Branch 19 not taken.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 22 not taken.
✗ Branch 23 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
✗ Branch 26 not taken.
✗ Branch 27 not taken.
✗ Branch 28 not taken.
✗ Branch 29 not taken.
✗ Branch 30 not taken.
✗ Branch 31 not taken.
✗ Branch 32 not taken.
✗ Branch 33 not taken.
✗ Branch 34 not taken.
✗ Branch 35 not taken.
✗ Branch 36 not taken.
✗ Branch 37 not taken.
✗ Branch 38 not taken.
✗ Branch 39 not taken.
✗ Branch 40 not taken.
✗ Branch 41 not taken.
✗ Branch 42 not taken.
✗ Branch 43 not taken.
✗ Branch 44 not taken.
✗ Branch 45 not taken.
✗ Branch 46 not taken.
✗ Branch 47 not taken.
✗ Branch 48 not taken.
✗ Branch 49 not taken.
✗ Branch 50 not taken.
✗ Branch 51 not taken.
✗ Branch 52 not taken.
✗ Branch 53 not taken.
✗ Branch 54 not taken.
✗ Branch 55 not taken.
✗ Branch 56 not taken.
✗ Branch 57 not taken.
✗ Branch 58 not taken.
✓ Branch 59 taken 541177 times.
✗ Branch 60 not taken.
✗ Branch 61 not taken.
✗ Branch 62 not taken.
✗ Branch 63 not taken.
✗ Branch 64 not taken.
✗ Branch 65 not taken.
✗ Branch 66 not taken.
✗ Branch 67 not taken.
✗ Branch 68 not taken.
✗ Branch 69 not taken.
✗ Branch 70 not taken.
✗ Branch 71 not taken.
✗ Branch 72 not taken.
✗ Branch 73 not taken.
✗ Branch 74 not taken.
✗ Branch 75 not taken.
✗ Branch 76 not taken.
✗ Branch 77 not taken.
✗ Branch 78 not taken.
✗ Branch 79 not taken.
✗ Branch 80 not taken.
✗ Branch 81 not taken.
✗ Branch 82 not taken.
✓ Branch 83 taken 5411680 times.
5953194 inline int Ceil(double x) { return int(RoundUp(x)); }
858 inline int Ceil(long double x) { return int(RoundUp(x)); }
859 //@}
860
861
862 /// Return @a x if it is greater or equal in magnitude than @a delta. Otherwise, return zero.
863 template<typename Type>
864 inline Type Chop(Type x, Type delta) { return (Abs(x) < delta ? zeroVal<Type>() : x); }
865
866
867 /// Return @a x truncated to the given number of decimal digits.
868 template<typename Type>
869 inline Type
870 28 Truncate(Type x, unsigned int digits)
871 {
872 28 Type tenth = static_cast<Type>(Pow(size_t(10), digits));
873 28 return RoundDown(x*tenth+0.5)/tenth;
874 }
875
876 ////////////////////////////////////////
877
878
879 /// @brief 8-bit integer values print to std::ostreams as characters.
880 /// Cast them so that they print as integers instead.
881 template<typename T>
882 inline auto PrintCast(const T& val) -> typename std::enable_if<!std::is_same<T, int8_t>::value
883 && !std::is_same<T, uint8_t>::value, const T&>::type { return val; }
884 inline int32_t PrintCast(int8_t val) { return int32_t(val); }
885 inline uint32_t PrintCast(uint8_t val) { return uint32_t(val); }
886
887
888 ////////////////////////////////////////
889
890
891 /// Return the inverse of @a x.
892 template<typename Type>
893 inline Type
894 Inv(Type x)
895 {
896 assert(x);
897 return Type(1)/x;
898 }
899
900
901 enum Axis {
902 X_AXIS = 0,
903 Y_AXIS = 1,
904 Z_AXIS = 2
905 };
906
907 // enum values are consistent with their historical mx analogs.
908 enum RotationOrder {
909 XYZ_ROTATION = 0,
910 XZY_ROTATION,
911 YXZ_ROTATION,
912 YZX_ROTATION,
913 ZXY_ROTATION,
914 ZYX_ROTATION,
915 XZX_ROTATION,
916 ZXZ_ROTATION
917 };
918
919
920 template <typename S, typename T>
921 struct promote {
922 using type = typename boost::numeric::conversion_traits<S, T>::supertype;
923 };
924
925 /// @brief Return the index [0,1,2] of the smallest value in a 3D vector.
926 /// @note This methods assumes operator[] exists.
927 /// @details The return value corresponds to the largest index of the of
928 /// the smallest vector components.
929 template<typename Vec3T>
930 size_t
931 11774755 MinIndex(const Vec3T& v)
932 {
933 size_t r = 0;
934
2/2
✓ Branch 0 taken 23549510 times.
✓ Branch 1 taken 11774755 times.
35324265 for (size_t i = 1; i < 3; ++i) {
935 // largest index (backwards compatibility)
936
2/2
✓ Branch 0 taken 22264084 times.
✓ Branch 1 taken 1285426 times.
23549510 if (v[i] <= v[r]) r = i;
937 }
938 11774755 return r;
939 }
940
941 /// @brief Return the index [0,1,2] of the largest value in a 3D vector.
942 /// @note This methods assumes operator[] exists.
943 /// @details The return value corresponds to the largest index of the of
944 /// the largest vector components.
945 template<typename Vec3T>
946 size_t
947 67493 MaxIndex(const Vec3T& v)
948 {
949 size_t r = 0;
950
2/2
✓ Branch 0 taken 134986 times.
✓ Branch 1 taken 67493 times.
202479 for (size_t i = 1; i < 3; ++i) {
951 // largest index (backwards compatibility)
952
2/2
✓ Branch 0 taken 39499 times.
✓ Branch 1 taken 95487 times.
134986 if (v[i] >= v[r]) r = i;
953 }
954 67493 return r;
955 }
956
957 } // namespace math
958 } // namespace OPENVDB_VERSION_NAME
959 } // namespace openvdb
960
961 #endif // OPENVDB_MATH_MATH_HAS_BEEN_INCLUDED
962