TDMatScalarDivExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_TDMATSCALARDIVEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_TDMATSCALARDIVEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
50 #include <blaze/util/InvalidType.h>
51 #include <blaze/util/mpl/And.h>
52 #include <blaze/util/mpl/If.h>
53 #include <blaze/util/mpl/Or.h>
62 
63 
64 namespace blaze {
65 
66 //=================================================================================================
67 //
68 // CLASS DEFINITION
69 //
70 //=================================================================================================
71 
72 //*************************************************************************************************
77 template< typename MT
78  , typename ST
79  , bool Condition >
80 struct TDMatScalarDivExprTraitHelper
81 {
82  private:
83  //**********************************************************************************************
84  typedef typename UnderlyingNumeric<MT>::Type NET;
85  typedef typename If< And< IsComplex<NET>, IsBuiltin<ST> >
86  , typename DivTrait<typename UnderlyingBuiltin<MT>::Type,ST>::Type
87  , typename DivTrait<NET,ST>::Type
88  >::Type ScalarType;
89  //**********************************************************************************************
90 
91  public:
92  //**********************************************************************************************
93  typedef typename If< IsInvertible<ScalarType>
94  , DMatScalarMultExpr<MT,ScalarType,true>
95  , DMatScalarDivExpr<MT,ScalarType,true>
96  >::Type Type;
97  //**********************************************************************************************
98 };
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
108 template< typename MT
109  , typename ST >
110 struct TDMatScalarDivExprTraitHelper<MT,ST,false>
111 {
112  public:
113  //**********************************************************************************************
114  typedef INVALID_TYPE Type;
115  //**********************************************************************************************
116 };
118 //*************************************************************************************************
119 
120 
121 //*************************************************************************************************
131 template< typename MT // Type of the left-hand side dense matrix
132  , typename ST > // Type of the right-hand side scalar
134 {
135  private:
136  //**********************************************************************************************
141  //**********************************************************************************************
142 
143  //**********************************************************************************************
145  typedef TDMatScalarDivExprTraitHelper<MT,ST,condition> Tmp;
146 
147  typedef typename RemoveReference< typename RemoveCV<MT>::Type >::Type Type1;
148  typedef typename RemoveReference< typename RemoveCV<ST>::Type >::Type Type2;
150  //**********************************************************************************************
151 
152  public:
153  //**********************************************************************************************
157  , TDMatScalarDivExprTrait<Type1,Type2>, Tmp >::Type::Type Type;
159  //**********************************************************************************************
160 };
161 //*************************************************************************************************
162 
163 } // namespace blaze
164 
165 #endif
Header file for the UnderlyingNumeric type trait.
Compile time check for numeric types.This type trait tests whether or not the given template paramete...
Definition: IsNumeric.h:98
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Compile time check for volatile data types.The IsVolatile type trait tests whether or not the given t...
Definition: IsVolatile.h:94
Header file for the RemoveCV type trait.
Header file for the IsColumnMajorMatrix type trait.
Header file for the And class template.
Header file for the IsVolatile type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the UnderlyingBuiltin type trait.
Header file for the Or class template.
Compile time check for dense matrix types.This type trait tests whether or not the given template par...
Definition: IsDenseMatrix.h:103
Header file for all forward declarations for expression class templates.
Header file for the IsDenseMatrix type trait.
Header file for the IsNumeric type trait.
Removal of reference modifiers.The RemoveCV type trait removes any reference modifiers from the given...
Definition: RemoveReference.h:69
Header file for the IsConst type trait.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:110
Utility type for generic codes.
Header file for the division trait.
Header file for the IsReference type trait.
Header file for the RemoveReference type trait.
Header file for the IsInvertible type trait.
Compile time check for constant data types.The IsConst type trait tests whether or not the given temp...
Definition: IsConst.h:94
Header file for the IsBuiltin type trait.
Compile time type check.This class tests whether the given template parameter T is a reference type (...
Definition: IsReference.h:94
Header file for the IsComplex type trait.
Evaluation of the expression type of a transpose dense matrix/scalar division.Via this type trait it ...
Definition: TDMatScalarDivExprTrait.h:133