Blaze  3.6
IsReal.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SHIMS_ISREAL_H_
36 #define _BLAZE_MATH_SHIMS_ISREAL_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/system/Inline.h>
46 #include <blaze/util/Complex.h>
47 #include <blaze/util/MaybeUnused.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // ISREAL SHIM
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
96 template< bool RF // Relaxation flag
97  , typename Type > // Type of the given value
98 BLAZE_ALWAYS_INLINE bool isReal( const Type& v ) noexcept
99 {
100  MAYBE_UNUSED( v );
101 
102  return IsBuiltin_v<Type>;
103 }
104 //*************************************************************************************************
105 
106 
107 //*************************************************************************************************
115 template< bool RF // Relaxation flag
116  , typename Type > // Type of the given value
117 BLAZE_ALWAYS_INLINE bool isReal( const complex<Type>& v ) noexcept( IsBuiltin_v<Type> )
118 {
119  return IsBuiltin_v<Type> && isZero<RF>( v.imag() );
120 }
122 //*************************************************************************************************
123 
124 
125 //*************************************************************************************************
148 template< typename Type >
149 BLAZE_ALWAYS_INLINE bool isReal( const Type& v ) noexcept
150 {
151  return isReal<relaxed>( v );
152 }
153 //*************************************************************************************************
154 
155 } // namespace blaze
156 
157 #endif
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:657
Header file for the isZero shim.
Header file for the MAYBE_UNUSED function template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition: Inline.h:85
constexpr void MAYBE_UNUSED(const Args &...)
Suppression of unused parameter warnings.
Definition: MaybeUnused.h:81
Header file for the relaxation flag types.
Header file for the IsBuiltin type trait.
Header file for the complex data type.
System settings for the inline keywords.