IsIdentity.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TYPETRAITS_ISIDENTITY_H_
36 #define _BLAZE_MATH_TYPETRAITS_ISIDENTITY_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
45 #include <blaze/util/FalseType.h>
46 #include <blaze/util/mpl/And.h>
47 #include <blaze/util/mpl/If.h>
48 #include <blaze/util/TrueType.h>
49 
50 
51 namespace blaze {
52 
53 //=================================================================================================
54 //
55 // CLASS DEFINITION
56 //
57 //=================================================================================================
58 
59 //*************************************************************************************************
91 template< typename T >
92 struct IsIdentity : public If< And< IsUniLower<T>, IsUniUpper<T> >, TrueType, FalseType >::Type
93 {
94  public:
95  //**********************************************************************************************
97  enum { value = IsUniLower<T>::value && IsUniUpper<T>::value };
98  typedef typename If< And< IsUniLower<T>, IsUniUpper<T> >, TrueType, FalseType >::Type Type;
100  //**********************************************************************************************
101 };
102 //*************************************************************************************************
103 
104 
105 //*************************************************************************************************
110 template< typename T >
111 struct IsIdentity< const T > : public IsIdentity<T>::Type
112 {
113  public:
114  //**********************************************************************************************
115  enum { value = IsIdentity<T>::value };
116  typedef typename IsIdentity<T>::Type Type;
117  //**********************************************************************************************
118 };
120 //*************************************************************************************************
121 
122 
123 //*************************************************************************************************
128 template< typename T >
129 struct IsIdentity< volatile T > : public IsIdentity<T>::Type
130 {
131  public:
132  //**********************************************************************************************
133  enum { value = IsIdentity<T>::value };
134  typedef typename IsIdentity<T>::Type Type;
135  //**********************************************************************************************
136 };
138 //*************************************************************************************************
139 
140 
141 //*************************************************************************************************
146 template< typename T >
147 struct IsIdentity< const volatile T > : public IsIdentity<T>::Type
148 {
149  public:
150  //**********************************************************************************************
151  enum { value = IsIdentity<T>::value };
152  typedef typename IsIdentity<T>::Type Type;
153  //**********************************************************************************************
154 };
156 //*************************************************************************************************
157 
158 } // namespace blaze
159 
160 #endif
Header file for the IsUniUpper type trait.
Compile time type selection.The If class template selects one of the two given types T2 and T3 depend...
Definition: If.h:112
Header file for the FalseType type/value trait base class.
Header file for the And class template.
Header file for the IsUniLower type trait.
Compile time check for upper unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniUpper.h:85
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the If class template.
Compile time check for lower unitriangular matrices.This type trait tests whether or not the given te...
Definition: IsUniLower.h:85
Compile time check for identity matrices.This type trait tests whether or not the given template para...
Definition: IsIdentity.h:92
boost::false_type FalseType
Type/value traits base class.The FalseType class is used as base class for type traits and value trai...
Definition: FalseType.h:61
boost::true_type TrueType
Type traits base class.The TrueType class is used as base class for type traits and value traits that...
Definition: TrueType.h:61
Header file for the TrueType type/value trait base class.