Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
shims
IsReal.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_SHIMS_ISREAL_H_
36
#define _BLAZE_MATH_SHIMS_ISREAL_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/RelaxationFlag.h
>
44
#include <
blaze/math/shims/IsZero.h
>
45
#include <
blaze/math/typetraits/IsScalar.h
>
46
#include <
blaze/system/Inline.h
>
47
#include <
blaze/util/Complex.h
>
48
#include <
blaze/util/EnableIf.h
>
49
#include <
blaze/util/MaybeUnused.h
>
50
#include <
blaze/util/typetraits/IsBuiltin.h
>
51
52
53
namespace
blaze {
54
55
//=================================================================================================
56
//
57
// ISREAL SHIM
58
//
59
//=================================================================================================
60
61
//*************************************************************************************************
98
template
<
RelaxationFlag
RF
// Relaxation flag
99
,
typename
Type
// Type of the given value
100
,
EnableIf_t< IsScalar_v<Type>
>* =
nullptr
>
101
BLAZE_ALWAYS_INLINE
bool
isReal
(
const
Type
& v )
noexcept
102
{
103
MAYBE_UNUSED
( v );
104
105
return
IsBuiltin_v<Type>
;
106
}
107
//*************************************************************************************************
108
109
110
//*************************************************************************************************
118
template
<
RelaxationFlag
RF
// Relaxation flag
119
,
typename
Type >
// Type of the given value
120
BLAZE_ALWAYS_INLINE
bool
isReal
(
const
complex<Type>
& v )
noexcept
(
IsBuiltin_v<Type>
)
121
{
122
return
IsBuiltin_v<Type>
&&
isZero<RF>
( v.imag() );
123
}
125
//*************************************************************************************************
126
127
128
//*************************************************************************************************
151
template
<
typename
Type >
152
BLAZE_ALWAYS_INLINE
bool
isReal
(
const
Type
& v )
noexcept
153
{
154
return
isReal<relaxed>
( v );
155
}
156
//*************************************************************************************************
157
158
}
// namespace blaze
159
160
#endif
Complex.h
Header file for the complex data type.
EnableIf.h
Header file for the EnableIf class template.
IsBuiltin.h
Header file for the IsBuiltin type trait.
IsScalar.h
Header file for the IsScalar type trait.
MaybeUnused.h
Header file for the MAYBE_UNUSED function template.
RelaxationFlag.h
Header file for the relaxation flag enumeration.
blaze::Type
complex
Complex data type of the Blaze library.
blaze::isZero
bool isZero(const DenseMatrix< MT, SO > &dm)
Checks if the given dense matrix is a zero matrix.
Definition
DenseMatrix.h:1819
blaze::RelaxationFlag
RelaxationFlag
Relaxation flag for strict or relaxed semantics.
Definition
RelaxationFlag.h:66
blaze::isReal
bool isReal(const Proxy< PT, RT > &proxy)
Returns whether the element represents a real number.
Definition
Proxy.h:2297
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
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
IsZero.h
Header file for the isZero shim.
Inline.h
System settings for the inline keywords.
Generated by
1.18.0