DVecScalarDivExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DVECSCALARDIVEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DVECSCALARDIVEXPRTRAIT_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 VT
78  , typename ST
79  , bool Condition >
80 struct DVecScalarDivExprTraitHelper
81 {
82  private:
83  //**********************************************************************************************
84  using ScalarType = If_< Or< IsFloatingPoint< UnderlyingBuiltin_<VT> >
85  , IsFloatingPoint< UnderlyingBuiltin_<ST> > >
86  , If_< And< IsComplex< UnderlyingNumeric_<VT> >
87  , IsBuiltin<ST> >
88  , DivTrait_< UnderlyingBuiltin_<VT>, ST >
89  , DivTrait_< UnderlyingNumeric_<VT>, ST > >
90  , ST >;
91  //**********************************************************************************************
92 
93  public:
94  //**********************************************************************************************
95  using Type = If_< IsInvertible<ScalarType>
96  , DVecScalarMultExpr<VT,ScalarType,false>
97  , DVecScalarDivExpr<VT,ScalarType,false> >;
98  //**********************************************************************************************
99 };
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
109 template< typename VT
110  , typename ST >
111 struct DVecScalarDivExprTraitHelper<VT,ST,false>
112 {
113  public:
114  //**********************************************************************************************
115  using Type = INVALID_TYPE;
116  //**********************************************************************************************
117 };
119 //*************************************************************************************************
120 
121 
122 //*************************************************************************************************
132 template< typename VT // Type of the left-hand side dense vector
133  , typename ST > // Type of the right-hand side scalar
135 {
136  private:
137  //**********************************************************************************************
139  enum : bool { condition = And< IsDenseVector<VT>, IsColumnVector<VT>, IsNumeric<ST> >::value };
141  //**********************************************************************************************
142 
143  public:
144  //**********************************************************************************************
146  using Type = typename If_< Or< IsConst<VT>, IsVolatile<VT>, IsReference<VT>
149  , DVecScalarDivExprTraitHelper<VT,ST,condition> >::Type;
151  //**********************************************************************************************
152 };
153 //*************************************************************************************************
154 
155 
156 //*************************************************************************************************
170 template< typename VT // Type of the left-hand side dense vector
171  , typename ST > // Type of the right-hand side scalar
173 //*************************************************************************************************
174 
175 } // namespace blaze
176 
177 #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:79
Compile time check for volatile data types.The IsVolatile type trait tests whether or not the given t...
Definition: IsVolatile.h:75
typename Decay< T >::Type Decay_
Auxiliary alias declaration for the Decay type trait.The Decay_ alias declaration provides a convenie...
Definition: Decay.h:98
Header file for the And class template.
Header file for the IsVolatile type trait.
Header file for the Decay type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Header file for the IsFloatingPoint type trait.
Header file for the UnderlyingBuiltin type trait.
Header file for the Or class template.
typename DVecScalarDivExprTrait< VT, ST >::Type DVecScalarDivExprTrait_
Auxiliary alias declaration for the DVecScalarDivExprTrait class template.The DVecScalarDivExprTrait_...
Definition: DVecScalarDivExprTrait.h:172
Compile time check for column vector types.This type trait tests whether or not the given template ar...
Definition: IsColumnVector.h:80
Header file for all forward declarations for expression class templates.
Header file for the IsNumeric type trait.
Header file for the IsConst type trait.
Utility type for generic codes.
Evaluation of the expression type of a dense vector/scalar division.Via this type trait it is possibl...
Definition: DVecScalarDivExprTrait.h:134
Header file for the division trait.
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:160
Header file for the IsReference 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:75
Header file for the IsDenseVector type trait.
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:75
Header file for the IsComplex type trait.
Compile time logical and evaluation.The And class template performs at compile time a logical and ('&&...
Definition: And.h:101
Header file for the IsColumnVector type trait.