DVecScalarMultExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DVECSCALARMULTEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DVECSCALARMULTEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
49 #include <blaze/util/InvalidType.h>
50 #include <blaze/util/mpl/And.h>
51 #include <blaze/util/mpl/If.h>
52 #include <blaze/util/mpl/Or.h>
60 
61 
62 namespace blaze {
63 
64 //=================================================================================================
65 //
66 // CLASS DEFINITION
67 //
68 //=================================================================================================
69 
70 //*************************************************************************************************
75 template< typename VT
76  , typename ST
77  , bool Condition >
78 struct DVecScalarMultExprTraitHelper
79 {
80  private:
81  //**********************************************************************************************
82  using ScalarType = If_< And< IsComplex< UnderlyingNumeric_<VT> >, IsBuiltin<ST> >
83  , MultTrait_< UnderlyingBuiltin_<VT>, ST >
84  , MultTrait_< UnderlyingNumeric_<VT>, ST > >;
85  //**********************************************************************************************
86 
87  public:
88  //**********************************************************************************************
89  using Type = DVecScalarMultExpr<VT,ScalarType,false>;
90  //**********************************************************************************************
91 };
93 //*************************************************************************************************
94 
95 
96 //*************************************************************************************************
101 template< typename VT
102  , typename ST >
103 struct DVecScalarMultExprTraitHelper<VT,ST,false>
104 {
105  public:
106  //**********************************************************************************************
107  using Type = INVALID_TYPE;
108  //**********************************************************************************************
109 };
111 //*************************************************************************************************
112 
113 
114 //*************************************************************************************************
124 template< typename VT // Type of the left-hand side dense vector
125  , typename ST > // Type of the right-hand side scalar
127 {
128  private:
129  //**********************************************************************************************
131  enum : bool { condition = And< IsDenseVector<VT>, IsColumnVector<VT>, IsNumeric<ST> >::value };
133  //**********************************************************************************************
134 
135  public:
136  //**********************************************************************************************
138  using Type = typename If_< Or< IsConst<VT>, IsVolatile<VT>, IsReference<VT>
141  , DVecScalarMultExprTraitHelper<VT,ST,condition> >::Type;
143  //**********************************************************************************************
144 };
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
162 template< typename VT // Type of the left-hand side dense vector
163  , typename ST > // Type of the right-hand side scalar
165 //*************************************************************************************************
166 
167 } // namespace blaze
168 
169 #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
typename DVecScalarMultExprTrait< VT, ST >::Type DVecScalarMultExprTrait_
Auxiliary alias declaration for the DVecScalarMultExprTrait class template.The DVecScalarMultExprTrai...
Definition: DVecScalarMultExprTrait.h:164
Compile time check for volatile data types.The IsVolatile type trait tests whether or not the given t...
Definition: IsVolatile.h:75
Evaluation of the expression type of a dense vector/scalar multiplication.Via this type trait it is p...
Definition: DVecScalarMultExprTrait.h:126
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.
Header file for the multiplication 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 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.
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.
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.