BinaryMapExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_BINARYMAPEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_BINARYMAPEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
46 #include <blaze/util/InvalidType.h>
47 #include <blaze/util/mpl/And.h>
48 #include <blaze/util/mpl/If.h>
49 #include <blaze/util/mpl/Or.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // CLASS DEFINITION
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
71 template< typename T1 // Type of the left-hand side binary map operand
72  , typename T2 // Type of the right-hand side binary map operand
73  , typename OP > // Type of the custom operation
75 {
76  private:
77  //**struct Failure******************************************************************************
79  struct Failure { using Type = INVALID_TYPE; };
81  //**********************************************************************************************
82 
83  //**struct Result*******************************************************************************
85  struct Result { using Type = decltype( map( std::declval<T1>()
86  , std::declval<T2>()
87  , std::declval<OP>() ) ); };
89  //**********************************************************************************************
90 
91  public:
92  //**********************************************************************************************
96  , Result
97  , Failure >::Type;
99  //**********************************************************************************************
100 };
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
117 template< typename T1 // Type of the left-hand side map operand
118  , typename T2 // Type of the right-hand side map operand
119  , typename OP > // Type of the custom operation
121 //*************************************************************************************************
122 
123 } // namespace blaze
124 
125 #endif
typename BinaryMapExprTrait< T1, T2, OP >::Type BinaryMapExprTrait_
Auxiliary alias declaration for the BinaryMapExprTrait class template.The BinaryMapExprTrait_ alias d...
Definition: BinaryMapExprTrait.h:120
Header file for the And class template.
Compile time check for matrix types.This type trait tests whether or not the given template parameter...
Definition: IsMatrix.h:103
Header file for the IsMatrix type trait.
Compile time check for vector types.This type trait tests whether or not the given template parameter...
Definition: IsVector.h:104
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the If class template.
Header file for the Or class template.
Evaluation of the return type of a binary map expression.Via this type trait it is possible to evalua...
Definition: BinaryMapExprTrait.h:74
Header file for the IsVector type trait.
Utility type for generic codes.
typename If< T1, T2, T3 >::Type If_
Auxiliary alias declaration for the If class template.The If_ alias declaration provides a convenient...
Definition: If.h:154
Header file for the RemoveReference type trait.
Compile time logical &#39;and&#39; evaluation.The And alias declaration performs at compile time a logical &#39;a...
Definition: And.h:76
decltype(auto) map(const DenseMatrix< MT1, SO > &lhs, const DenseMatrix< MT2, SO > &rhs, OP op)
Evaluates the given binary operation on each single element of the dense matrices lhs and rhs...
Definition: DMatDMatMapExpr.h:1134