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 
47 #include <blaze/util/mpl/And.h>
48 #include <blaze/util/mpl/Equal.h>
49 #include <blaze/util/mpl/Or.h>
51 
52 
53 namespace blaze {
54 
55 //=================================================================================================
56 //
57 // MUST_BE_MATMATSUBEXPR_TYPE CONSTRAINT
58 //
59 //=================================================================================================
60 
61 //*************************************************************************************************
68 #define BLAZE_CONSTRAINT_MUST_BE_MATMATSUBEXPR_TYPE(T) \
69  static_assert( ::blaze::IsMatMatSubExpr<T>::value, "Non-matrix/matrix subtraction expression type detected" )
70 //*************************************************************************************************
71 
72 
73 
74 
75 //=================================================================================================
76 //
77 // MUST_NOT_BE_MATMATSUBEXPR_TYPE CONSTRAINT
78 //
79 //=================================================================================================
80 
81 //*************************************************************************************************
88 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATSUBEXPR_TYPE(T) \
89  static_assert( !::blaze::IsMatMatSubExpr<T>::value, "Matrix/matrix subtraction expression type detected" )
90 //*************************************************************************************************
91 
92 
93 
94 
95 //=================================================================================================
96 //
97 // MUST_FORM_VALID_MATMATSUBEXPR CONSTRAINT
98 //
99 //=================================================================================================
100 
101 //*************************************************************************************************
108 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATSUBEXPR(T1,T2) \
109  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
110  , ::blaze::IsMatrix<T2> \
111  , ::blaze::Or< ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::PtrdiffT<-1L> > \
112  , ::blaze::Equal< ::blaze::Rows<T2>, ::blaze::PtrdiffT<-1L> > \
113  , ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::Rows<T2> > > \
114  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::PtrdiffT<-1L> > \
115  , ::blaze::Equal< ::blaze::Columns<T2>, ::blaze::PtrdiffT<-1L> > \
116  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Columns<T2> > > \
117  >::value, "Invalid matrix/matrix subtraction expression detected" )
118 //*************************************************************************************************
119 
120 } // namespace blaze
121 
122 #endif
Header file for the Rows type trait.
Header file for the And class template.
Header file for the IsMatrix type trait.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the Or class template.
Header file for the Columns type trait.
Header file for the PtrdiffT class template.
Header file for the IsMatMatSubExpr type trait class.
Header file for the Equal class template.