IsZero.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SHIMS_ISZERO_H_
36 #define _BLAZE_MATH_SHIMS_ISZERO_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/system/Inline.h>
46 #include <blaze/util/DisableIf.h>
47 #include <blaze/util/EnableIf.h>
49 #include <blaze/util/Unused.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // ISZERO SHIM
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
102 template< bool RF // Relaxation flag
103  , typename Type > // Type of the given value/object
104 BLAZE_ALWAYS_INLINE EnableIf_< IsNumeric<Type>, bool > isZero( const Type& v ) noexcept
105 {
106  return isDefault<RF>( v );
107 }
108 //*************************************************************************************************
109 
110 
111 //*************************************************************************************************
119 template< bool RF // Relaxation flag
120  , typename Type > // Type of the given value/object
121 BLAZE_ALWAYS_INLINE DisableIf_< IsNumeric<Type>, bool > isZero( const Type& v ) noexcept
122 {
123  UNUSED_PARAMETER( v );
124 
125  return false;
126 }
128 //*************************************************************************************************
129 
130 
131 //*************************************************************************************************
173 template< typename Type > // Type of the given value/object
174 BLAZE_ALWAYS_INLINE bool isZero( const Type& v ) noexcept
175 {
176  return isZero<relaxed>( v );
177 }
178 //*************************************************************************************************
179 
180 } // namespace blaze
181 
182 #endif
Header file for the UNUSED_PARAMETER function template.
typename DisableIf< Condition, T >::Type DisableIf_
Auxiliary type for the DisableIf class template.The DisableIf_ alias declaration provides a convenien...
Definition: DisableIf.h:224
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:642
Header file for the DisableIf class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
Header file for the relaxation flag types.
Header file for the isDefault shim.
typename EnableIf< Condition, T >::Type EnableIf_
Auxiliary alias declaration for the EnableIf class template.The EnableIf_ alias declaration provides ...
Definition: EnableIf.h:224
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
System settings for the inline keywords.