Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
shims
Greater.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_SHIMS_GREATER_H_
36
#define _BLAZE_MATH_SHIMS_GREATER_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/system/Inline.h
>
44
#include <
blaze/util/typetraits/CommonType.h
>
45
#include <
blaze/util/typetraits/IsBuiltin.h
>
46
47
48
namespace
blaze {
49
50
//=================================================================================================
51
//
52
// GREATER SHIM
53
//
54
//=================================================================================================
55
56
//*************************************************************************************************
67
template
<
typename
T >
68
BLAZE_ALWAYS_INLINE
constexpr
bool
greater_backend(
const
T& a,
const
T& b )
69
noexcept
(
IsBuiltin_v<T>
)
70
{
71
return
a > b;
72
}
74
//*************************************************************************************************
75
76
77
//*************************************************************************************************
91
BLAZE_ALWAYS_INLINE
constexpr
bool
greater_backend(
float
a,
float
b )
noexcept
92
{
93
return
( b - a ) > 1E-8F;
94
}
96
//*************************************************************************************************
97
98
99
//*************************************************************************************************
113
BLAZE_ALWAYS_INLINE
constexpr
bool
greater_backend(
double
a,
double
b )
noexcept
114
{
115
return
( b - a ) > 1E-8;
116
}
118
//*************************************************************************************************
119
120
121
//*************************************************************************************************
135
BLAZE_ALWAYS_INLINE
constexpr
bool
greater_backend(
long
double
a,
long
double
b )
noexcept
136
{
137
return
( b - a ) > 1E-10L;
138
}
140
//*************************************************************************************************
141
142
143
//*************************************************************************************************
155
template
<
typename
T1,
typename
T2 >
156
BLAZE_ALWAYS_INLINE
constexpr
bool
greater
(
const
T1& a,
const
T2& b )
157
noexcept
(
IsBuiltin_v< CommonType_t<T1,T2>
> )
158
{
159
return
greater_backend< CommonType_t<T1,T2> >( a, b );
160
}
161
//*************************************************************************************************
162
163
}
// namespace blaze
164
165
#endif
CommonType.h
Header file for the CommonType type trait.
IsBuiltin.h
Header file for the IsBuiltin type trait.
blaze::greater
BLAZE_ALWAYS_INLINE constexpr bool greater(const T1 &a, const T2 &b) noexcept(IsBuiltin_v< CommonType_t< T1, T2 > >)
Generic greater-than comparison.
Definition
Greater.h:156
BLAZE_ALWAYS_INLINE
#define BLAZE_ALWAYS_INLINE
Platform dependent setup of an enforced inline keyword.
Definition
Inline.h:85
blaze::IsBuiltin_v
constexpr bool IsBuiltin_v
Auxiliary variable template for the IsBuiltin type trait.
Definition
IsBuiltin.h:95
Inline.h
System settings for the inline keywords.
Generated by
1.18.0