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 
44 #include <blaze/system/Inline.h>
45 #include <blaze/util/Complex.h>
47 #include <blaze/util/Unused.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // ISREAL SHIM
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
81 template< typename Type >
82 BLAZE_ALWAYS_INLINE bool isReal( const Type& v ) noexcept
83 {
84  UNUSED_PARAMETER( v );
85 
87 }
88 //*************************************************************************************************
89 
90 
91 //*************************************************************************************************
99 template< typename Type >
100 BLAZE_ALWAYS_INLINE bool isReal( const complex<Type>& v ) noexcept( IsBuiltin<Type>::value )
101 {
102  return IsBuiltin<Type>::value && isZero( v.imag() );
103 }
105 //*************************************************************************************************
106 
107 } // namespace blaze
108 
109 #endif
Header file for the UNUSED_PARAMETER function template.
bool isReal(const DiagonalProxy< MT > &proxy)
Returns whether the matrix element represents a real number.
Definition: DiagonalProxy.h:595
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 isZero shim.
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.
bool isZero(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 0.
Definition: DiagonalProxy.h:615
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.