Belle II Software development
|
Namespace to hide the constants of the ESign enumeration. More...
Enumerations | |
enum | ESign : signed short { c_Plus = 1 , c_Minus = -1 , c_Zero = 0 , c_Invalid = SHRT_MIN } |
Enumeration for the distinct sign values of floating point variables. More... | |
Functions | |
ESign | opposite (ESign s) |
Return the opposite sign. Leaves ESign::c_Invalid the same. | |
bool | isValid (ESign s) |
Returns true if sign is ESign::c_Plus, ESign::c_Minus or ESign::c_Zero. | |
static ESign | common (ESign n1, ESign n2) |
Check if two values have a common sign. | |
static ESign | common (float n1, float n2) |
Check if two values have a common sign. | |
static ESign | common (float n1, float n2, float n3, float n4) |
Check if four values have a common sign. | |
template<class FloatRange > | |
static ESign | common (const FloatRange &as) |
Check if four values have a common sign. | |
Namespace to hide the constants of the ESign enumeration.
enum ESign : signed short |
Enumeration for the distinct sign values of floating point variables.
Enumerator | |
---|---|
c_Plus | Constant for plus sign. |
c_Minus | Constant for minus sign. |
c_Zero | Constant for undefined sign. |
c_Invalid | Constant for invalid sign, e.g. the sign of NAN. |
Definition at line 27 of file ESign.h.
|
inlinestatic |
Check if four values have a common sign.
Ignores nan values. Returns ESign::c_Plus if all signs are positive. Returns ESign::c_Minus if all signs are negative. Returns ESign::c_Zero for mixed signs. Returns ESign::c_Invalid if all input are NaN.
Definition at line 104 of file ESign.h.
Check if two values have a common sign.
Ignores ESign::c_Invalid values. Returns ESign::c_Plus if all signs are positive. Returns ESign::c_Minus if all signs are negative. Returns ESign::c_Zero for mixed signs. Returns ESign::c_Invalid if all input are c_Invalid
Definition at line 57 of file ESign.h.
|
inlinestatic |
Check if two values have a common sign.
Ignores nan values. Returns ESign::c_Plus if all signs are positive. Returns ESign::c_Minus if all signs are negative. Returns ESign::c_Zero for mixed signs. Returns ESign::c_Invalid if all input are NaN.
Definition at line 72 of file ESign.h.
|
inlinestatic |
Check if four values have a common sign.
Ignores nan values. Returns ESign::c_Plus if all signs are positive. Returns ESign::c_Minus if all signs are negative. Returns ESign::c_Zero for mixed signs. Returns ESign::c_Invalid if all input are NaN.
Definition at line 87 of file ESign.h.
|
inline |