MatMatAddExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_CONSTRAINTS_MATMATADDEXPR_H_
36 #define _BLAZE_MATH_CONSTRAINTS_MATMATADDEXPR_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/Not.h>
50 #include <blaze/util/mpl/Or.h>
51 #include <blaze/util/mpl/SizeT.h>
52 
53 
54 namespace blaze {
55 
56 //=================================================================================================
57 //
58 // MUST_BE_MATMATADDEXPR_TYPE CONSTRAINT
59 //
60 //=================================================================================================
61 
62 //*************************************************************************************************
69 #define BLAZE_CONSTRAINT_MUST_BE_MATMATADDEXPR_TYPE(T) \
70  static_assert( ::blaze::IsMatMatAddExpr<T>::value, "Non-matrix/matrix addition expression type detected" )
71 //*************************************************************************************************
72 
73 
74 
75 
76 //=================================================================================================
77 //
78 // MUST_NOT_BE_MATMATADDEXPR_TYPE CONSTRAINT
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATADDEXPR_TYPE(T) \
90  static_assert( !::blaze::IsMatMatAddExpr<T>::value, "Matrix/matrix addition expression type detected" )
91 //*************************************************************************************************
92 
93 
94 
95 
96 //=================================================================================================
97 //
98 // MUST_FORM_VALID_MATMATADDEXPR CONSTRAINT
99 //
100 //=================================================================================================
101 
102 //*************************************************************************************************
109 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATADDEXPR(T1,T2) \
110  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
111  , ::blaze::IsMatrix<T2> \
112  , ::blaze::Or< ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::SizeT<0UL> > \
113  , ::blaze::Equal< ::blaze::Rows<T2>, ::blaze::SizeT<0UL> > \
114  , ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::Rows<T2> > > \
115  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::SizeT<0UL> > \
116  , ::blaze::Equal< ::blaze::Columns<T2>, ::blaze::SizeT<0UL> > \
117  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Columns<T2> > > \
118  >::value, "Invalid matrix/matrix addition expression detected" )
119 //*************************************************************************************************
120 
121 
122 
123 
124 //=================================================================================================
125 //
126 // MUST_NOT_FORM_VALID_MATMATADDEXPR CONSTRAINT
127 //
128 //=================================================================================================
129 
130 //*************************************************************************************************
137 #define BLAZE_CONSTRAINT_MUST_NOT_FORM_VALID_MATMATADDEXPR(T1,T2) \
138  static_assert( ::blaze::Not< ::blaze::And< ::blaze::IsMatrix<T1> \
139  , ::blaze::IsMatrix<T2> \
140  , ::blaze::Or< ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::SizeT<0UL> > \
141  , ::blaze::Equal< ::blaze::Rows<T2>, ::blaze::SizeT<0UL> > \
142  , ::blaze::Equal< ::blaze::Rows<T1>, ::blaze::Rows<T2> > > \
143  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::SizeT<0UL> > \
144  , ::blaze::Equal< ::blaze::Columns<T2>, ::blaze::SizeT<0UL> > \
145  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Columns<T2> > > > \
146  >::value, "Valid matrix/matrix addition expression detected" )
147 //*************************************************************************************************
148 
149 } // namespace blaze
150 
151 #endif
Header file for the Rows type trait.
Header file for the And class template.
Header file for the SizeT class template.
Header file for the IsMatMatAddExpr type trait class.
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 Not class template.
Header file for the Equal class template.