SubvectorExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_SUBVECTOREXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_SUBVECTOREXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
49 #include <blaze/util/InvalidType.h>
50 #include <blaze/util/mpl/If.h>
51 #include <blaze/util/mpl/Or.h>
57 
58 
59 namespace blaze {
60 
61 //=================================================================================================
62 //
63 // CLASS DEFINITION
64 //
65 //=================================================================================================
66 
67 //*************************************************************************************************
76 template< typename VT // Type of the vector operand
77  , bool AF > // Alignment Flag
79 {
80  private:
81  //**struct Failure******************************************************************************
83  struct Failure { typedef INVALID_TYPE Type; };
85  //**********************************************************************************************
86 
87  //**struct DenseResult**************************************************************************
89  template< typename T >
90  struct DenseResult { typedef DenseSubvector<T,AF,IsRowVector<T>::value> Type; };
92  //**********************************************************************************************
93 
94  //**struct SparseResult*************************************************************************
96  template< typename T >
97  struct SparseResult { typedef SparseSubvector<T,AF,IsRowVector<T>::value> Type; };
99  //**********************************************************************************************
100 
101  //**********************************************************************************************
103  typedef typename RemoveReference<VT>::Type Tmp;
105  //**********************************************************************************************
106 
107  public:
108  //**********************************************************************************************
110  typedef typename If< Or< IsComputation<Tmp>, IsTransExpr<Tmp> >
113  , Failure
114  >::Type
115  , typename If< IsDenseVector<Tmp>
116  , DenseResult<Tmp>
117  , typename If< IsSparseVector<Tmp>
118  , SparseResult<Tmp>
119  , Failure
120  >::Type
121  >::Type
122  >::Type::Type Type;
124  //**********************************************************************************************
125 };
126 //*************************************************************************************************
127 
128 } // namespace blaze
129 
130 #endif
View on a specific subvector of a sparse vector.The SparseSubvector template represents a view on a s...
Definition: Forward.h:54
Evaluation of the expression type type of a subvector operation.Via this type trait it is possible to...
Definition: SubvectorExprTrait.h:78
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 IsRowVector type trait.
Header file for the IsTransExpr type trait class.
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 Or class template.
Compile time check whether the given type is a transposition expression template.This type trait clas...
Definition: IsTransExpr.h:88
Header file for all forward declarations for views.
Header file for the IsSparseVector 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.
View on a specific subvector of a dense vector.The DenseSubvector template represents a view on a spe...
Definition: DenseSubvector.h:392
Header file for the IsReference type trait.
Header file for the RemoveReference type trait.
Header file for the IsDenseVector type trait.
Header file for the IsComputation type trait class.