TSMatScalarDivExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_TSMATSCALARDIVEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_TSMATSCALARDIVEXPRTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
50 #include <blaze/util/InvalidType.h>
51 #include <blaze/util/mpl/And.h>
52 #include <blaze/util/mpl/If.h>
53 #include <blaze/util/mpl/Or.h>
61 
62 
63 namespace blaze {
64 
65 //=================================================================================================
66 //
67 // CLASS DEFINITION
68 //
69 //=================================================================================================
70 
71 //*************************************************************************************************
76 template< typename MT
77  , typename ST
78  , bool Condition >
79 struct TSMatScalarDivExprTraitHelper
80 {
81  private:
82  //**********************************************************************************************
83  using ScalarType = If_< Or< IsFloatingPoint< UnderlyingBuiltin_<MT> >
84  , IsFloatingPoint< UnderlyingBuiltin_<ST> > >
85  , If_< And< IsComplex< UnderlyingNumeric_<MT> >
86  , IsBuiltin<ST> >
87  , DivTrait_< UnderlyingBuiltin_<MT>, ST >
88  , DivTrait_< UnderlyingNumeric_<MT>, ST > >
89  , ST >;
90  //**********************************************************************************************
91 
92  public:
93  //**********************************************************************************************
94  using Type = If_< IsInvertible<ScalarType>
95  , SMatScalarMultExpr<MT,ScalarType,true>
96  , SMatScalarDivExpr<MT,ScalarType,true> >;
97  //**********************************************************************************************
98 };
100 //*************************************************************************************************
101 
102 
103 //*************************************************************************************************
108 template< typename MT
109  , typename ST >
110 struct TSMatScalarDivExprTraitHelper<MT,ST,false>
111 {
112  public:
113  //**********************************************************************************************
114  using Type = INVALID_TYPE;
115  //**********************************************************************************************
116 };
118 //*************************************************************************************************
119 
120 
121 //*************************************************************************************************
131 template< typename MT // Type of the left-hand side sparse matrix
132  , typename ST > // Type of the right-hand side scalar
134 {
135  private:
136  //**********************************************************************************************
138  enum : bool { condition = And< IsSparseMatrix<MT>, IsColumnMajorMatrix<MT>, IsNumeric<ST> >::value };
140  //**********************************************************************************************
141 
142  public:
143  //**********************************************************************************************
145  using Type = typename If_< Or< IsConst<MT>, IsVolatile<MT>, IsReference<MT>
148  , TSMatScalarDivExprTraitHelper<MT,ST,condition> >::Type;
150  //**********************************************************************************************
151 };
152 //*************************************************************************************************
153 
154 
155 //*************************************************************************************************
169 template< typename MT // Type of the left-hand side sparse matrix
170  , typename ST > // Type of the right-hand side scalar
172 //*************************************************************************************************
173 
174 } // namespace blaze
175 
176 #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
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.
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.
Evaluation of the expression type of a transpose sparse matrix/scalar division.Via this type trait it...
Definition: TSMatScalarDivExprTrait.h:133
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.
Header file for the division trait.
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.
Header file for the IsInvertible 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
typename TSMatScalarDivExprTrait< MT, ST >::Type TSMatScalarDivExprTrait_
Auxiliary alias declaration for the TSMatScalarDivExprTrait class template.The TSMatScalarDivExprTrai...
Definition: TSMatScalarDivExprTrait.h:171