Blaze 3.9
Loading...
Searching...
No Matches
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
45#include <blaze/system/Inline.h>
46#include <blaze/util/EnableIf.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// ISONE SHIM
56//
57//=================================================================================================
58
59//*************************************************************************************************
103template< RelaxationFlag RF // Relaxation flag
104 , typename Type // Type of the given value/object
105 , EnableIf_t< IsNumeric_v<Type> >* = nullptr >
106BLAZE_ALWAYS_INLINE bool isOne( const Type& v ) noexcept
107{
108 return equal<RF>( v, Type(1) );
109}
110//*************************************************************************************************
111
112
113//*************************************************************************************************
121template< RelaxationFlag RF // Relaxation flag
122 , typename Type // Type of the given value/object
123 , DisableIf_t< IsNumeric_v<Type> >* = nullptr >
124BLAZE_ALWAYS_INLINE bool isOne( const Type& v ) noexcept
125{
126 MAYBE_UNUSED( v );
127
128 return false;
129}
131//*************************************************************************************************
132
133
134//*************************************************************************************************
178template< typename Type >
180{
181 return isOne<relaxed>( v );
182}
183//*************************************************************************************************
184
185} // namespace blaze
186
187#endif
Header file for the EnableIf class template.
Header file for the IsNumeric type trait.
Header file for the MAYBE_UNUSED function template.
Header file for the relaxation flag enumeration.
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition RelaxationFlag.h:66
bool isOne(const Proxy< PT, RT > &proxy)
Returns whether the represented element is 1.
Definition Proxy.h:2337
bool equal(const SharedValue< T1 > &lhs, const SharedValue< T2 > &rhs)
Equality check for a two shared values.
Definition SharedValue.h:343
#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
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:138
typename EnableIf<!Condition, T >::Type DisableIf_t
Auxiliary type for the EnableIf class template.
Definition EnableIf.h:175
Header file for the equal shim.
System settings for the inline keywords.