IBAMR  IBAMR version 0.19.
Static Public Member Functions | List of all members
SAMRAI::tbox::IEEE Struct Reference

#include <tbox/IEEE.h>

Static Public Member Functions

static void setupFloatingPointExceptionHandlers ()
 
static float getSignalingFloatNaN ()
 
static double getSignalingNaN ()
 
static dcomplex getSignalingComplexNaN ()
 
static void setNaN (float &f)
 
static void setNaN (double &d)
 
static void setNaN (dcomplex &dc)
 
static void initializeArrayToSignalingNaN (Array< float > &array)
 
static void initializeArrayToSignalingNaN (Array< double > &array)
 
static void initializeArrayToSignalingNaN (Array< dcomplex > &array)
 
static void initializeArrayToSignalingNaN (float *array, int n=1)
 
static void initializeArrayToSignalingNaN (double *array, int n=1)
 
static void initializeArrayToSignalingNaN (dcomplex *array, int n=1)
 
static bool isNaN (const float &f)
 
static bool isNaN (const double &d)
 
static bool isNaN (const dcomplex &dc)
 

Detailed Description

Class IEEE is a utility providing rotuines for managing IEEE trap handlers and data set to signaling NaNs. Signaling NaNs force a trap if they are used in a numerical operation, so they are a useful way to track uninitialized floating point data. Signaling NaN's may only be used for double and float data (and the real ans imaginary parts of dcomplex data) and so operations are provided here for those types only.

IMPORTANT: To properly trap operations based on signaling NaN values, the routine IEEE::setupFloatingPointExceptionHandlers() must be called. This is normally done in the SAMRAIManager::startup() routine.

Note that all operations provided by this class (except for setting up exception handling) are implemented in

See also
tbox::MathUtilities.
Operations are provided by this class since it is not templated on data type and so calling the operations provided here may be easier in some cases, such as in codes built based on earlier versions of SAMRAI. See the tbox::MathUtilities header file for details about the routines.
tbox::MathUtilities

Member Function Documentation

◆ setupFloatingPointExceptionHandlers()

static void SAMRAI::tbox::IEEE::setupFloatingPointExceptionHandlers ( )
static

Set up IEEE exception handlers so that normal IEEE exceptions will cause a program abort. This is useful for tracking down errors. Note, however, that this may cause problems if your code relies on IEEE underflow or overflow traps.

◆ getSignalingFloatNaN()

static float SAMRAI::tbox::IEEE::getSignalingFloatNaN ( )
static

Get the IEEE float signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.

◆ getSignalingNaN()

static double SAMRAI::tbox::IEEE::getSignalingNaN ( )
static

Get the IEEE double signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.

◆ getSignalingComplexNaN()

static dcomplex SAMRAI::tbox::IEEE::getSignalingComplexNaN ( )
static

Get the dcomplex value with real and imaginary parts set to the IEEE double signaling NaN on architectures that support it. Using this value in a numerical expression will cause a program abort.

◆ setNaN() [1/3]

static void SAMRAI::tbox::IEEE::setNaN ( float &  f)
static

Set supplied float value to the signaling NaN.

◆ setNaN() [2/3]

static void SAMRAI::tbox::IEEE::setNaN ( double d)
static

Set supplied double value to the signaling NaN.

◆ setNaN() [3/3]

static void SAMRAI::tbox::IEEE::setNaN ( dcomplex dc)
static

Set real and imaginary parts of supplied dcomplex value to the double signaling NaN.

◆ initializeArrayToSignalingNaN() [1/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( Array< float > &  array)
static

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ initializeArrayToSignalingNaN() [2/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( Array< double > &  array)
static

Initialize an array of doubles to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ initializeArrayToSignalingNaN() [3/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( Array< dcomplex > &  array)
static

Initialize an array of dcomplex to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ initializeArrayToSignalingNaN() [4/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( float *  array,
int  n = 1 
)
static

Initialize an array of floats to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ initializeArrayToSignalingNaN() [5/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( double array,
int  n = 1 
)
static

Initialize an array of doubles to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ initializeArrayToSignalingNaN() [6/6]

static void SAMRAI::tbox::IEEE::initializeArrayToSignalingNaN ( dcomplex array,
int  n = 1 
)
static

Initialize an array of dcomplex to signaling NaNs. Before using this array in any operation, the NaN value should be reset. Otherwise, an unrecoverable exception will result (as long as floating point exception handling is supported by the compiler).

◆ isNaN() [1/3]

static bool SAMRAI::tbox::IEEE::isNaN ( const float &  f)
static

Return true if the supplied float value is NaN; else, false.

◆ isNaN() [2/3]

static bool SAMRAI::tbox::IEEE::isNaN ( const double d)
static

Return true if the supplied double value is NaN; else, false.

◆ isNaN() [3/3]

static bool SAMRAI::tbox::IEEE::isNaN ( const dcomplex dc)
static

Return true if if either real and imaginary part of the supplied
dcomplex value is NaN; else, false.


The documentation for this struct was generated from the following file: