blob: dcafd131c157044db46e9a09dcae5b3ed79bbf8c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
  | 
#ifndef CONTOURPY_UTIL_H
#define CONTOURPY_UTIL_H
#include "common.h"
namespace contourpy {
class Util
{
public:
    static void ensure_nan_loaded();
    static index_t get_max_threads();
    static bool is_nan(double value);
    // This is the NaN used internally and returned to calling functions. The value is taken from
    // numpy rather than the standard C++ approach so that it is guaranteed to work with
    // numpy.isnan(). The value is actually the same for many platforms, but this approach
    // guarantees it works for all platforms that numpy supports.
    //
    // ensure_nan_loaded() must be called before this value is read.
    static double nan;
private:
    static bool _nan_loaded;
};
} // namespace contourpy
#endif // CONTOURPY_UTIL_H
  |