SubmatrixExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_SUBMATRIXEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_SUBMATRIXEXPRTRAIT_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 MT // Type of the matrix 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 DenseSubmatrix<T,AF,IsColumnMajorMatrix<T>::value> Type; };
92  //**********************************************************************************************
93 
94  //**struct SparseResult*************************************************************************
96  template< typename T >
97  struct SparseResult { typedef SparseSubmatrix<T,AF,IsColumnMajorMatrix<T>::value> Type; };
99  //**********************************************************************************************
100 
101  //**********************************************************************************************
103  typedef typename RemoveReference<MT>::Type Tmp;
105  //**********************************************************************************************
106 
107  public:
108  //**********************************************************************************************
110  typedef typename If< Or< IsComputation<Tmp>, IsTransExpr<Tmp> >
113  , Failure
114  >::Type
115  , typename If< IsDenseMatrix<Tmp>
116  , DenseResult<Tmp>
117  , typename If< IsSparseMatrix<Tmp>
118  , SparseResult<Tmp>
119  , Failure
120  >::Type
121  >::Type
122  >::Type::Type Type;
124  //**********************************************************************************************
125 };
126 //*************************************************************************************************
127 
128 } // namespace blaze
129 
130 #endif
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 IsSparseMatrix type trait.
Header file for the RemoveCV type trait.
Header file for the IsColumnMajorMatrix 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.
Evaluation of the expression type type of a submatrix operation.Via this type trait it is possible to...
Definition: SubmatrixExprTrait.h:78
Header file for the IsDenseMatrix type trait.
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.
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 submatrix of a sparse matrix.The SparseSubmatrix template represents a view on a s...
Definition: Forward.h:53
Header file for the IsReference type trait.
Header file for the RemoveReference type trait.
Header file for the IsComputation type trait class.
View on a specific submatrix of a dense matrix.The DenseSubmatrix template represents a view on a spe...
Definition: DenseSubmatrix.h:474