Blaze  3.6
DeclHermTrait.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_TRAITS_DECLHERMTRAIT_H_
36 #define _BLAZE_MATH_TRAITS_DECLHERMTRAIT_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <utility>
47 #include <blaze/util/InvalidType.h>
48 
49 
50 namespace blaze {
51 
52 //=================================================================================================
53 //
54 // CLASS DEFINITION
55 //
56 //=================================================================================================
57 
58 //*************************************************************************************************
60 template< typename > struct DeclHermTrait;
61 template< typename, typename = void > struct DeclHermTraitEval;
63 //*************************************************************************************************
64 
65 
66 //*************************************************************************************************
68 template< typename T >
69 auto evalDeclHermTrait( T& )
70  -> typename DeclHermTraitEval<T>::Type;
71 
72 template< typename T >
73 auto evalDeclHermTrait( const T& )
74  -> typename DeclHermTrait<T>::Type;
75 
76 template< typename T >
77 auto evalDeclHermTrait( const volatile T& )
78  -> typename DeclHermTrait<T>::Type;
80 //*************************************************************************************************
81 
82 
83 //*************************************************************************************************
133 template< typename MT > // Type of the matrix
135 {
136  public:
137  //**********************************************************************************************
139  using Type = decltype( evalDeclHermTrait( std::declval<MT&>() ) );
141  //**********************************************************************************************
142 };
143 //*************************************************************************************************
144 
145 
146 //*************************************************************************************************
159 template< typename MT > // Type of the matrix
161 //*************************************************************************************************
162 
163 
164 //*************************************************************************************************
169 template< typename MT // Type of the matrix
170  , typename > // Restricting condition
171 struct DeclHermTraitEval
172 {
173  using Type = INVALID_TYPE;
174 };
176 //*************************************************************************************************
177 
178 
179 //*************************************************************************************************
184 template< typename MT > // Type of the matrix
185 struct DeclHermTraitEval< MT
186  , EnableIf_t< IsMatrix_v<MT> &&
187  ( Size_v<MT,0UL> == DefaultSize_v ||
188  Size_v<MT,1UL> == DefaultSize_v ||
189  Size_v<MT,0UL> == Size_v<MT,1UL> ) > >
190 {
191  using Type = HermitianMatrix<typename MT::ResultType>;
192 };
194 //*************************************************************************************************
195 
196 } // namespace blaze
197 
198 #endif
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.The IsMatrix_v variable template provides a c...
Definition: IsMatrix.h:138
typename DeclHermTrait< MT >::Type DeclHermTrait_t
Auxiliary alias declaration for the DeclHermTrait type trait.The DeclHermTrait_t alias declaration pr...
Definition: DeclHermTrait.h:160
Header file for the IsMatrix type trait.
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.The EnableIf_t alias declaration provides a convenient...
Definition: EnableIf.h:138
Namespace of the Blaze C++ math library.
Definition: Blaze.h:58
Header file for the implementation of the base template of the HeritianMatrix.
Base template for the DeclHermTrait class.
Definition: DeclHermTrait.h:134
Utility type for generic codes.
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
Header file for the Size type trait.