SMatScalarDivExprTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_SMATSCALARDIVEXPRTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_SMATSCALARDIVEXPRTRAIT_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>
62 
63 
64 namespace blaze {
65 
66 //=================================================================================================
67 //
68 // CLASS DEFINITION
69 //
70 //=================================================================================================
71 
72 //*************************************************************************************************
77 template< typename MT
78  , typename ST
79  , bool Condition >
80 struct SMatScalarDivExprTraitHelper
81 {
82  private:
83  //**********************************************************************************************
84  using ScalarType = If_< Or< IsFloatingPoint< UnderlyingBuiltin_<MT> >
85  , IsFloatingPoint< UnderlyingBuiltin_<ST> > >
86  , If_< And< IsComplex< UnderlyingNumeric_<MT> >
87  , IsBuiltin<ST> >
88  , DivTrait_< UnderlyingBuiltin_<MT>, ST >
89  , DivTrait_< UnderlyingNumeric_<MT>, ST > >
90  , ST >;
91  //**********************************************************************************************
92 
93  public:
94  //**********************************************************************************************
95  using Type = If_< IsInvertible<ScalarType>
96  , SMatScalarMultExpr<MT,ScalarType,false>
97  , SMatScalarDivExpr<MT,ScalarType,false> >;
98  //**********************************************************************************************
99 };
101 //*************************************************************************************************
102 
103 
104 //*************************************************************************************************
109 template< typename MT
110  , typename ST >
111 struct SMatScalarDivExprTraitHelper<MT,ST,false>
112 {
113  public:
114  //**********************************************************************************************
115  using Type = INVALID_TYPE;
116  //**********************************************************************************************
117 };
119 //*************************************************************************************************
120 
121 
122 //*************************************************************************************************
132 template< typename MT // Type of the left-hand side sparse matrix
133  , typename ST > // Type of the right-hand side scalar
135 {
136  private:
137  //**********************************************************************************************
139  enum : bool { condition = And< IsSparseMatrix<MT>, IsRowMajorMatrix<MT>, IsNumeric<ST> >::value };
141  //**********************************************************************************************
142 
143  public:
144  //**********************************************************************************************
146  using Type = typename If_< Or< IsConst<MT>, IsVolatile<MT>, IsReference<MT>
149  , SMatScalarDivExprTraitHelper<MT,ST,condition> >::Type;
151  //**********************************************************************************************
152 };
153 //*************************************************************************************************
154 
155 
156 //*************************************************************************************************
170 template< typename MT // Type of the left-hand side sparse matrix
171  , typename ST > // Type of the right-hand side scalar
173 //*************************************************************************************************
174 
175 } // namespace blaze
176 
177 #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.
Evaluation of the expression type of a sparse matrix/scalar division.Via this type trait it is possib...
Definition: SMatScalarDivExprTrait.h:134
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 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.
Compile time check for row-major matrix types.This type trait tests whether or not the given template...
Definition: IsRowMajorMatrix.h:83
Header file for the IsFloatingPoint type trait.
Header file for the UnderlyingBuiltin type trait.
Header file for the Or class template.
typename SMatScalarDivExprTrait< MT, ST >::Type SMatScalarDivExprTrait_
Auxiliary alias declaration for the SMatScalarDivExprTrait class template.The SMatScalarDivExprTrait_...
Definition: SMatScalarDivExprTrait.h:172
Header file for all forward declarations for expression class templates.
Header file for the IsNumeric type trait.
Header file for the IsConst type trait.
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 IsRowMajorMatrix 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: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