UnaryMapExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_UNARYMAPEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_UNARYMAPEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
46 #include <blaze/util/InvalidType.h>
47 #include <blaze/util/mpl/If.h>
48 #include <blaze/util/mpl/Or.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // CLASS DEFINITION
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
69 template< typename T // Type of the unary map operand
70  , typename OP > // Type of the custom operation
72 {
73  private:
74  //**struct Failure******************************************************************************
76  struct Failure { using Type = INVALID_TYPE; };
78  //**********************************************************************************************
79 
80  //**struct Result*******************************************************************************
82  struct Result { using Type = decltype( map( std::declval<T>(), std::declval<OP>() ) ); };
84  //**********************************************************************************************
85 
86  public:
87  //**********************************************************************************************
90  , Result
91  , Failure
92  >::Type;
94  //**********************************************************************************************
95 };
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
112 template< typename T // Type of the unary map operand
113  , typename OP > // Type of the custom operation
115 //*************************************************************************************************
116 
117 } // namespace blaze
118 
119 #endif
Evaluation of the return type of a unary map expression.Via this type trait it is possible to evaluat...
Definition: UnaryMapExprTrait.h:71
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.
typename UnaryMapExprTrait< T, OP >::Type UnaryMapExprTrait_
Auxiliary alias declaration for the UnaryMapExprTrait class template.The UnaryMapExprTrait_ alias dec...
Definition: UnaryMapExprTrait.h:114
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the Or class template.
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.
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:1133