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