MatMatMultExpr.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_CONSTRAINTS_MATMATMULTEXPR_H_
36 #define _BLAZE_MATH_CONSTRAINTS_MATMATMULTEXPR_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_MATMATMULTEXPR_TYPE CONSTRAINT
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
67 #define BLAZE_CONSTRAINT_MUST_BE_MATMATMULTEXPR_TYPE(T) \
68  static_assert( ::blaze::IsMatMatMultExpr<T>::value, "Non-matrix/matrix multiplication expression type detected" )
69 //*************************************************************************************************
70 
71 
72 
73 
74 //=================================================================================================
75 //
76 // MUST_NOT_BE_MATMATMULTEXPR_TYPE CONSTRAINT
77 //
78 //=================================================================================================
79 
80 //*************************************************************************************************
87 #define BLAZE_CONSTRAINT_MUST_NOT_BE_MATMATMULTEXPR_TYPE(T) \
88  static_assert( !::blaze::IsMatMatMultExpr<T>::value, "Matrix/matrix multiplication expression type detected" )
89 //*************************************************************************************************
90 
91 
92 
93 
94 //=================================================================================================
95 //
96 // MUST_FORM_VALID_MATMATMULTEXPR CONSTRAINT
97 //
98 //=================================================================================================
99 
100 //*************************************************************************************************
107 #define BLAZE_CONSTRAINT_MUST_FORM_VALID_MATMATMULTEXPR(T1,T2) \
108  static_assert( ::blaze::And< ::blaze::IsMatrix<T1> \
109  , ::blaze::IsMatrix<T2> \
110  , ::blaze::Or< ::blaze::Equal< ::blaze::Size<T1,1UL>, ::blaze::PtrdiffT<-1L> > \
111  , ::blaze::Equal< ::blaze::Size<T2,0UL>, ::blaze::PtrdiffT<-1L> > \
112  , ::blaze::Equal< ::blaze::Size<T1,1UL>, ::blaze::Size<T2,0UL> > > \
113  >::value, "Invalid matrix/matrix multiplication expression detected" )
114 //*************************************************************************************************
115 
116 } // namespace blaze
117 
118 #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 IsMatMatMultExpr type trait class.
Header file for the PtrdiffT class template.
Header file for the Size type trait.
Header file for the Equal class template.