Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
typetraits
IsCommutative.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TYPETRAITS_ISCOMMUTATIVE_H_
36
#define _BLAZE_MATH_TYPETRAITS_ISCOMMUTATIVE_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <
blaze/math/typetraits/IsMatrix.h
>
44
#include <
blaze/math/typetraits/IsVector.h
>
45
#include <
blaze/math/typetraits/UnderlyingElement.h
>
46
#include <
blaze/util/EnableIf.h
>
47
#include <
blaze/util/IntegralConstant.h
>
48
#include <
blaze/util/typetraits/IsNumeric.h
>
49
50
51
namespace
blaze {
52
53
//=================================================================================================
54
//
55
// CLASS DEFINITION
56
//
57
//=================================================================================================
58
59
//*************************************************************************************************
81
template
<
typename
T1,
typename
T2,
typename
=
void
>
82
struct
IsCommutative
83
:
public
BoolConstant
< IsNumeric_v<T1> || IsNumeric_v<T2> >
84
{};
85
//*************************************************************************************************
86
87
88
//*************************************************************************************************
93
template
<
typename
T1,
typename
T2 >
94
struct
IsCommutative
< T1, T2
95
,
EnableIf_t
< (
IsVector_v
<T1> &&
IsVector_v<T2>
) ||
96
(
IsMatrix_v<T1>
&&
IsMatrix_v<T2>
) > >
97
:
public
BoolConstant< IsCommutative< UnderlyingElement_t<T1>
,
UnderlyingElement_t<T2>
>::value >
98
{};
100
//*************************************************************************************************
101
102
103
//*************************************************************************************************
116
template
<
typename
T1,
typename
T2 >
117
constexpr
bool
IsCommutative_v
=
IsCommutative<T1,T2>::value
;
118
//*************************************************************************************************
119
120
}
// namespace blaze
121
122
#endif
EnableIf.h
Header file for the EnableIf class template.
IntegralConstant.h
Header file for the IntegralConstant class template.
IsMatrix.h
Header file for the IsMatrix type trait.
IsNumeric.h
Header file for the IsNumeric type trait.
IsVector.h
Header file for the IsVector type trait.
UnderlyingElement.h
Header file for the UnderlyingElement type trait.
blaze::UnderlyingElement_t
typename UnderlyingElement< T >::Type UnderlyingElement_t
Auxiliary alias declaration for the UnderlyingElement type trait.
Definition
UnderlyingElement.h:119
blaze::IsCommutative_v
constexpr bool IsCommutative_v
Auxiliary variable template for the IsCommutative type trait.
Definition
IsCommutative.h:117
blaze::IsVector_v
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.
Definition
IsVector.h:125
blaze::IsMatrix_v
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition
IsMatrix.h:124
blaze::EnableIf_t
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:138
blaze::BoolConstant
IntegralConstant< bool, B > BoolConstant
Generic wrapper for a compile time constant boolean value.
Definition
IntegralConstant.h:110
blaze::IsCommutative
Compile time check for the commutativity of data types.
Definition
IsCommutative.h:84
Generated by
1.18.0