IsOne.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_SHIMS_ISONE_H_
36 #define _BLAZE_MATH_SHIMS_ISONE_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <blaze/math/shims/Equal.h>
44 #include <blaze/system/Inline.h>
45 #include <blaze/util/DisableIf.h>
46 #include <blaze/util/EnableIf.h>
48 #include <blaze/util/Unused.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // ISONE SHIM
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
80 template< typename Type >
81 BLAZE_ALWAYS_INLINE typename EnableIf< IsNumeric<Type>, bool >::Type
82  isOne( const Type& v )
83 {
84  return equal( v, Type(1) );
85 }
86 //*************************************************************************************************
87 
88 
89 //*************************************************************************************************
97 template< typename Type >
98 BLAZE_ALWAYS_INLINE typename DisableIf< IsNumeric<Type>, bool >::Type
99  isOne( const Type& v )
100 {
101  UNUSED_PARAMETER( v );
102 
103  return false;
104 }
106 //*************************************************************************************************
107 
108 } // namespace blaze
109 
110 #endif
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:609
Header file for the UNUSED_PARAMETER function template.
void UNUSED_PARAMETER(const T1 &)
Suppression of unused parameter warnings.
Definition: Unused.h:81
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 equal shim.
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
bool equal(const T1 &a, const T2 &b)
Generic equality check.
Definition: Equal.h:73
System settings for the inline keywords.