All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // CLASS DEFINITION
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
76 template< typename VT
77  , typename ST
78  , bool Condition >
79 struct DVecScalarMultExprTraitHelper
80 {
81  private:
82  //**********************************************************************************************
83  typedef typename NumericElementType<VT>::Type NET;
84  typedef typename If< And< IsComplex<NET>, IsBuiltin<ST> >
85  , typename BaseElementType<VT>::Type
86  , typename MultTrait<NET,ST>::Type
87  >::Type ElementType;
88  //**********************************************************************************************
89 
90  public:
91  //**********************************************************************************************
92  typedef DVecScalarMultExpr<VT,ElementType,false> Type;
93  //**********************************************************************************************
94 };
96 //*************************************************************************************************
97 
98 
99 //*************************************************************************************************
104 template< typename VT
105  , typename ST >
106 struct DVecScalarMultExprTraitHelper<VT,ST,false>
107 {
108  public:
109  //**********************************************************************************************
110  typedef INVALID_TYPE Type;
111  //**********************************************************************************************
112 };
114 //*************************************************************************************************
115 
116 
117 //*************************************************************************************************
127 template< typename VT // Type of the left-hand side dense vector
128  , typename ST > // Type of the right-hand side scalar
130 {
131  private:
132  //**********************************************************************************************
134  enum { condition = IsDenseVector<VT>::value && IsColumnVector<VT>::value &&
137  //**********************************************************************************************
138 
139  //**********************************************************************************************
141  typedef DVecScalarMultExprTraitHelper<VT,ST,condition> Tmp;
142 
143  typedef typename RemoveReference< typename RemoveCV<VT>::Type >::Type Type1;
144  typedef typename RemoveReference< typename RemoveCV<ST>::Type >::Type Type2;
146  //**********************************************************************************************
147 
148  public:
149  //**********************************************************************************************
153  , DVecScalarMultExprTrait<Type1,Type2>, Tmp >::Type::Type Type;
155  //**********************************************************************************************
156 };
157 //*************************************************************************************************
158 
159 } // namespace blaze
160 
161 #endif
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.
Evaluation of the expression type of a dense vector/scalar multiplication.Via this type trait it is p...
Definition: DVecScalarMultExprTrait.h:129
Header file for the And class template.
Header file for the IsVolatile type trait.
Compile time check for dense vector types.This type trait tests whether or not the given template par...
Definition: IsDenseVector.h:103
Header file for the multiplication trait.
Header file for the If class template.
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:107
Type ElementType
Type of the sparse matrix elements.
Definition: CompressedMatrix.h:2476
Header file for all forward declarations for expression class templates.
Header file for the BaseElementType 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.
Utility type for generic codes.
Header file for the IsReference type trait.
Header file for the RemoveReference 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 NumericElementType type trait.
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:94
Header file for the IsComplex type trait.
Header file for the IsColumnVector type trait.