Blaze 3.9
DeclDiagTrait.h
Go to the documentation of this file.
1//=================================================================================================
33//=================================================================================================
34
35#ifndef _BLAZE_MATH_TRAITS_DECLDIAGTRAIT_H_
36#define _BLAZE_MATH_TRAITS_DECLDIAGTRAIT_H_
37
38
39//*************************************************************************************************
40// Includes
41//*************************************************************************************************
42
43#include <utility>
47#include <blaze/util/EnableIf.h>
49
50
51namespace blaze {
52
53//=================================================================================================
54//
55// CLASS DEFINITION
56//
57//=================================================================================================
58
59//*************************************************************************************************
61template< typename > struct DeclDiagTrait;
62template< typename, typename = void > struct DeclDiagTraitEval;
64//*************************************************************************************************
65
66
67//*************************************************************************************************
69template< typename T >
70auto evalDeclDiagTrait( const volatile T& ) -> DeclDiagTraitEval<T>;
72//*************************************************************************************************
73
74
75//*************************************************************************************************
124template< typename MT > // Type of the matrix
126 : public decltype( evalDeclDiagTrait( std::declval<MT&>() ) )
127{};
128//*************************************************************************************************
129
130
131//*************************************************************************************************
144template< typename MT > // Type of the matrix
146//*************************************************************************************************
147
148
149//*************************************************************************************************
154template< typename MT // Type of the matrix
155 , typename > // Restricting condition
156struct DeclDiagTraitEval
157{};
159//*************************************************************************************************
160
161
162//*************************************************************************************************
167template< typename MT > // Type of the matrix
168struct DeclDiagTraitEval< MT
169 , EnableIf_t< IsMatrix_v<MT> &&
170 ( Size_v<MT,0UL> == DefaultSize_v ||
171 Size_v<MT,1UL> == DefaultSize_v ||
172 Size_v<MT,0UL> == Size_v<MT,1UL> ) > >
173{
174 using Type = DiagonalMatrix<typename MT::ResultType>;
175};
177//*************************************************************************************************
178
179} // namespace blaze
180
181#endif
Header file for the EnableIf class template.
Utility type for generic codes.
Header file for the IsMatrix type trait.
Header file for the implementation of the base template of the DiagonalMatrix.
typename DeclDiagTrait< MT >::Type DeclDiagTrait_t
Auxiliary alias declaration for the DeclDiagTrait type trait.
Definition: DeclDiagTrait.h:145
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition: Size.h:72
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition: IsMatrix.h:124
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
Header file for the Size type trait.
Base template for the DeclDiagTrait class.
Definition: DeclDiagTrait.h:127