69 template<
class T>
class UList;
81 static bool switchFpe_;
85 static bool switchNan_;
88 static bool sigActive_;
91 static bool nanActive_;
97 static void sigHandler(
int);
129 static void set(
bool verbose=
false);
132 static void unset(
bool verbose=
false);
static void unset(bool verbose=false)
Deactivate SIGFPE handler and NaN memory initialisation.
static bool active() noexcept
True if SIGFPE handling is currently active.
ignore()
Constructor deactivates any previously active SIGFPE handler.
~sigFpe()
Destructor calls unset() to deactivate the FPE signal handler as required.
static void set(bool verbose=false)
Activate SIGFPE handler when FOAM_SIGFPE is enabled. Activate fill memory with signaling_NaN when FOA...
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Set up trapping for floating point exceptions (signal FPE).
~ignore()
Destructor restores the original state of SIGFPE handler.
Helper to locally ignore SIGFPE handling.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static bool nanActive() noexcept
True if NaN memory initialisation is currently active.
Typedefs for float/double/scalar without requiring scalar.H.
void operator=(const ignore &)=delete
No copy assignment.
void reset()
Restore the original state of SIGFPE handler.
static void fillNan(char *buf, size_t count)
Fill data block with signaling_NaN values.
static bool requested()
Check if SIGFPE signals handler is to be enabled.
sigFpe()
Constructor calls set() to activate the FPE signal handler if it was was not previously activate and ...
void restore()
Same as reset()