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 
44 #include <blaze/math/shims/Equal.h>
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 // ISONE SHIM
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
104 template< bool RF // Relaxation flag
105  , typename Type > // Type of the given value/object
107 {
108  return equal<RF>( v, Type(1) );
109 }
110 //*************************************************************************************************
111 
112 
113 //*************************************************************************************************
121 template< bool RF // Relaxation flag
122  , typename Type > // Type of the given value/object
123 BLAZE_ALWAYS_INLINE DisableIf_t< IsNumeric_v<Type>, bool > isOne( const Type& v ) noexcept
124 {
125  UNUSED_PARAMETER( v );
126 
127  return false;
128 }
130 //*************************************************************************************************
131 
132 
133 //*************************************************************************************************
177 template< typename Type >
178 BLAZE_ALWAYS_INLINE bool isOne( const Type& v )
179 {
180  return isOne<relaxed>( v );
181 }
182 //*************************************************************************************************
183 
184 } // namespace blaze
185 
186 #endif
Header file for the UNUSED_PARAMETER function template.
constexpr void UNUSED_PARAMETER(const Args &...)
Suppression of unused parameter warnings.
Definition: Unused.h:81
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Header file for the DisableIf class 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 equal shim.
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
Header file for the relaxation flag types.
bool isOne(const DiagonalProxy< MT > &proxy)
Returns whether the represented element is 1.
Definition: DiagonalProxy.h:693
System settings for the inline keywords.