MatMatSubExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_CONSTRAINTS_MATMATSUBEXPR_H_
36 #define _BLAZE_MATH_CONSTRAINTS_MATMATSUBEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
46 #include <blaze/util/mpl/And.h>
47 #include <blaze/util/mpl/Equal.h>
48 #include <blaze/util/mpl/Or.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // MUST_BE_MATMATSUBEXPR_TYPE CONSTRAINT
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
67 #define BLAZE_CONSTRAINT_MUST_BE_MATMATSUBEXPR_TYPE(T) \
68  static_assert( ::blaze::IsMatMatSubExpr<T>::value, "Non-matrix/matrix subtraction expression type detected" )
69 //*************************************************************************************************
70 
71 
72 
73 
74 //=================================================================================================
75 //
76 // MUST_NOT_BE_MATMATSUBEXPR_TYPE CONSTRAINT
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATSUBEXPR_TYPE(T) \
88  static_assert( !::blaze::IsMatMatSubExpr<T>::value, "Matrix/matrix subtraction expression type detected" )
89 //*************************************************************************************************
90 
91 
92 
93 
94 //=================================================================================================
95 //
96 // MUST_FORM_VALID_MATMATSUBEXPR CONSTRAINT
97 //
98 //=================================================================================================
99 
100 //*************************************************************************************************
107 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATSUBEXPR(T1,T2) \
108  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
109  , ::blaze::IsMatrix<T2> \
110  , ::blaze::Or< ::blaze::Equal< ::blaze::Size<T1,0UL>, ::blaze::PtrdiffT<-1L> > \
111  , ::blaze::Equal< ::blaze::Size<T2,0UL>, ::blaze::PtrdiffT<-1L> > \
112  , ::blaze::Equal< ::blaze::Size<T1,0UL>, ::blaze::Size<T2,0UL> > > \
113  , ::blaze::Or< ::blaze::Equal< ::blaze::Size<T1,1UL>, ::blaze::PtrdiffT<-1L> > \
114  , ::blaze::Equal< ::blaze::Size<T2,1UL>, ::blaze::PtrdiffT<-1L> > \
115  , ::blaze::Equal< ::blaze::Size<T1,1UL>, ::blaze::Size<T2,1UL> > > \
116  >::value, "Invalid matrix/matrix subtraction expression detected" )
117 //*************************************************************************************************
118 
119 } // namespace blaze
120 
121 #endif
Header file for the And class template.
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the Or class template.
Header file for the PtrdiffT class template.
Header file for the IsMatMatSubExpr type trait class.
Header file for the Size type trait.
Header file for the Equal class template.