Rows.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_CONSTRAINTS_ROWS_H_
36 #define _BLAZE_MATH_CONSTRAINTS_ROWS_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/util/mpl/Equal.h>
46 #include <blaze/util/mpl/Not.h>
47 #include <blaze/util/mpl/Or.h>
48 #include <blaze/util/mpl/SizeT.h>
49 #include <blaze/util/Suffix.h>
50 
51 
52 namespace blaze {
53 
54 //=================================================================================================
55 //
56 // MUST_HAVE_EQUAL_NUMBER_OF_ROWS CONSTRAINT
57 //
58 //=================================================================================================
59 
60 //*************************************************************************************************
70 template< bool > struct CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED;
71 template<> struct CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED<true> { enum { value = 1 }; };
73 //*************************************************************************************************
74 
75 
76 //*************************************************************************************************
85 #define BLAZE_CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS(T1,T2) \
86  typedef \
87  blaze::CONSTRAINT_TEST< \
88  blaze::CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED< ( \
89  blaze::Or< blaze::Equal< blaze::Rows<T1>, blaze::SizeT<0UL> > \
90  , blaze::Equal< blaze::Rows<T2>, blaze::SizeT<0UL> > \
91  , blaze::Equal< blaze::Rows<T1>, blaze::Rows<T2> > \
92  >::value ) >::value > \
93  BLAZE_JOIN( CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS_TYPEDEF, __LINE__ )
94 //*************************************************************************************************
95 
96 
97 
98 
99 //=================================================================================================
100 //
101 // MUST_NOT_HAVE_EQUAL_NUMBER_OF_ROWS CONSTRAINT
102 //
103 //=================================================================================================
104 
105 //*************************************************************************************************
115 template< bool > struct CONSTRAINT_MUST_NOT_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED;
116 template<> struct CONSTRAINT_MUST_NOT_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED<true> { enum { value = 1 }; };
118 //*************************************************************************************************
119 
120 
121 //*************************************************************************************************
130 #define BLAZE_CONSTRAINT_MUST_NOT_HAVE_EQUAL_NUMBER_OF_ROWS(T1,T2) \
131  typedef \
132  blaze::CONSTRAINT_TEST< \
133  blaze::CONSTRAINT_MUST_HAVE_EQUAL_NUMBER_OF_ROWS_FAILED< ( \
134  blaze::Or< blaze::Equal< blaze::Rows<T1>, blaze::SizeT<0UL> > \
135  , blaze::Equal< blaze::Rows<T2>, blaze::SizeT<0UL> > \
136  , blaze::Not< blaze::Equal< blaze::Rows<T1>, blaze::Rows<T2> > > \
137  >::value ) >::value > \
138  BLAZE_JOIN( CONSTRAINT_MUST_NOT_HAVE_EQUAL_NUMBER_OF_ROWS_TYPEDEF, __LINE__ )
139 //*************************************************************************************************
140 
141 } // namespace blaze
142 
143 #endif
Header file for the Rows type trait.
Header file for the SizeT class template.
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the Or class template.
Header file for the Not class template.
Constraint wrapper class.
Header file for compile time constraints.
Header file for the Equal class template.