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/Or.h>
52 
53 
54 namespace blaze {
55 
56 //=================================================================================================
57 //
58 // MUST_BE_MATVECMULTEXPR_TYPE CONSTRAINT
59 //
60 //=================================================================================================
61 
62 //*************************************************************************************************
69 #define BLAZE_CONSTRAINT_MUST_BE_MATVECMULTEXPR_TYPE(T) \
70  static_assert( ::blaze::IsMatVecMultExpr<T>::value, "Non-matrix/vector multiplication expression type detected" )
71 //*************************************************************************************************
72 
73 
74 
75 
76 //=================================================================================================
77 //
78 // MUST_NOT_BE_MATVECMULTEXPR_TYPE CONSTRAINT
79 //
80 //=================================================================================================
81 
82 //*************************************************************************************************
89 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATVECMULTEXPR_TYPE(T) \
90  static_assert( !::blaze::IsMatVecMultExpr<T>::value, "Matrix/vector multiplication expression type detected" )
91 //*************************************************************************************************
92 
93 
94 
95 
96 //=================================================================================================
97 //
98 // MUST_FORM_VALID_MATVECMULTEXPR CONSTRAINT
99 //
100 //=================================================================================================
101 
102 //*************************************************************************************************
109 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATVECMULTEXPR(T1,T2) \
110  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
111  , ::blaze::IsColumnVector<T2> \
112  , ::blaze::Or< ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::PtrdiffT<-1L> > \
113  , ::blaze::Equal< ::blaze::Size<T2>, ::blaze::PtrdiffT<-1L> > \
114  , ::blaze::Equal< ::blaze::Columns<T1>, ::blaze::Size<T2> > > \
115  >::value, "Invalid matrix/vector multiplication expression detected" )
116 //*************************************************************************************************
117 
118 } // namespace blaze
119 
120 #endif
Header file for the And 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 PtrdiffT class template.
Header file for the IsColumnVector type trait.
Header file for the Size type trait.
Header file for the Equal class template.