MatVecMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_CONSTRAINTS_MATVECMULTEXPR_H_
36 #define _BLAZE_MATH_CONSTRAINTS_MATVECMULTEXPR_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
48 #include <blaze/util/mpl/And.h>
49 #include <blaze/util/mpl/Equal.h>
50 #include <blaze/util/mpl/Not.h>
51 #include <blaze/util/mpl/Or.h>
52 #include <blaze/util/mpl/SizeT.h>
53 
54 
55 namespace blaze {
56 
57 //=================================================================================================
58 //
59 // MUST_BE_MATVECMULTEXPR_TYPE CONSTRAINT
60 //
61 //=================================================================================================
62 
63 //*************************************************************************************************
70 #define BLAZE_CONSTRAINT_MUST_BE_MATVECMULTEXPR_TYPE(T) \
71  static_assert( ::blaze::IsMatVecMultExpr<T>::value, "Non-matrix/vector multiplication expression type detected" )
72 //*************************************************************************************************
73 
74 
75 
76 
77 //=================================================================================================
78 //
79 // MUST_NOT_BE_MATVECMULTEXPR_TYPE CONSTRAINT
80 //
81 //=================================================================================================
82 
83 //*************************************************************************************************
90 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATVECMULTEXPR_TYPE(T) \
91  static_assert( !::blaze::IsMatVecMultExpr<T>::value, "Matrix/vector multiplication expression type detected" )
92 //*************************************************************************************************
93 
94 
95 
96 
97 //=================================================================================================
98 //
99 // MUST_FORM_VALID_MATVECMULTEXPR CONSTRAINT
100 //
101 //=================================================================================================
102 
103 //*************************************************************************************************
110 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1,T2) \
111  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
112  , ::blaze::IsColumnVector<T2> \
113  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::SizeT<0UL> > \
114  , ::blaze::Equal< ::blaze::Size<T2>, ::blaze::SizeT<0UL> > \
115  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Size<T2> > > \
116  >::value, "Invalid matrix/vector multiplication expression detected" )
117 //*************************************************************************************************
118 
119 
120 
121 
122 //=================================================================================================
123 //
124 // MUST_NOT_FORM_VALID_MATVECMULTEXPR CONSTRAINT
125 //
126 //=================================================================================================
127 
128 //*************************************************************************************************
135 #define BLAZE_CONSTRAINT_MUST_NOT_FORM_VALID_MATVECMULTEXPR(T1,T2) \
136  static_assert( ::blaze::Not< ::blaze::And< ::blaze::IsMatrix<T1> \
137  , ::blaze::IsColumnVector<T2> \
138  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::SizeT<0UL> > \
139  , ::blaze::Equal< ::blaze::Size<T2>, ::blaze::SizeT<0UL> > \
140  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Size<T2> > > > \
141  >::value, "Valid matrix/vector multiplication expression detected" )
142 //*************************************************************************************************
143 
144 } // namespace blaze
145 
146 #endif
Header file for the And class template.
Header file for the SizeT class template.
Header file for the IsMatVecMultExpr 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 IsColumnVector type trait.
Header file for the Size type trait.
Header file for the Equal class template.