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>
48 #include <blaze/util/Unused.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  UNUSED_PARAMETER( v );
101 
102  return IsBuiltin<Type>::value;
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<Type>::value )
118 {
119  return IsBuiltin<Type>::value && 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:650
Header file for the UNUSED_PARAMETER 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
Header file for the isZero shim.
Header file for the relaxation flag types.
Compile time check for built-in data types.This type trait tests whether or not the given template pa...
Definition: IsBuiltin.h:75
Header file for the IsBuiltin type trait.
Header file for the complex data type.
void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
System settings for the inline keywords.