TSMatScalarMultExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_TSMATSCALARMULTEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_TSMATSCALARMULTEXPRTRAIT_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 MT
76  , typename ST
77  , bool Condition >
78 struct TSMatScalarMultExprTraitHelper
79 {
80  private:
81  //**********************************************************************************************
82  using ScalarType = If_< And< IsComplex< UnderlyingNumeric_<MT> >, IsBuiltin<ST> >
83  , MultTrait_< UnderlyingBuiltin_<MT>, ST >
84  , MultTrait_< UnderlyingNumeric_<MT>, ST > >;
85  //**********************************************************************************************
86 
87  public:
88  //**********************************************************************************************
89  using Type = SMatScalarMultExpr<MT,ScalarType,true>;
90  //**********************************************************************************************
91 };
93 //*************************************************************************************************
94 
95 
96 //*************************************************************************************************
101 template< typename MT
102  , typename ST >
103 struct TSMatScalarMultExprTraitHelper<MT,ST,false>
104 {
105  public:
106  //**********************************************************************************************
107  using Type = INVALID_TYPE;
108  //**********************************************************************************************
109 };
111 //*************************************************************************************************
112 
113 
114 //*************************************************************************************************
124 template< typename MT // Type of the left-hand side sparse matrix
125  , typename ST > // Type of the right-hand side scalar
127 {
128  private:
129  //**********************************************************************************************
131  enum : bool { condition = And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>, IsNumeric<ST> >::value };
133  //**********************************************************************************************
134 
135  public:
136  //**********************************************************************************************
138  using Type = typename If_< Or< IsConst<MT>, IsVolatile<MT>, IsReference<MT>
141  , TSMatScalarMultExprTraitHelper<MT,ST,condition> >::Type;
143  //**********************************************************************************************
144 };
145 //*************************************************************************************************
146 
147 
148 //*************************************************************************************************
162 template< typename MT // Type of the left-hand side sparse matrix
163  , typename ST > // Type of the right-hand side scalar
165 //*************************************************************************************************
166 
167 } // namespace blaze
168 
169 #endif
Evaluation of the expression type of a transpose sparse matrix/scalar multiplication.Via this type trait it is possible to evaluate the resulting expression type of a transpose sparse matrix/scalar multiplication. Given the column-major sparse matrix type MT and the scalar type ST, the nested type Type corresponds to the resulting expression type. In case either MT is not a column-major sparse matrix type or ST is not a scalar type, the resulting Type is set to INVALID_TYPE.
Definition: TSMatScalarMultExprTrait.h:126
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
Header file for the IsSparseMatrix type trait.
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 IsColumnMajorMatrix type trait.
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.
Header file for all forward declarations for expression class templates.
Header file for the IsNumeric type trait.
Header file for the IsConst type trait.
Compile time check for column-major matrix types.This type trait tests whether or not the given templ...
Definition: IsColumnMajorMatrix.h:83
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
typename TSMatScalarMultExprTrait< MT, ST >::Type TSMatScalarMultExprTrait_
Auxiliary alias declaration for the TSMatScalarMultExprTrait class template.The TSMatScalarMultExprTr...
Definition: TSMatScalarMultExprTrait.h:164
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 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