Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
traits
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>
44
#include <
blaze/math/adaptors/diagonalmatrix/BaseTemplate.h
>
45
#include <
blaze/math/typetraits/IsMatrix.h
>
46
#include <
blaze/math/typetraits/Size.h
>
47
#include <
blaze/util/EnableIf.h
>
48
#include <
blaze/util/InvalidType.h
>
49
50
51
namespace
blaze {
52
53
//=================================================================================================
54
//
55
// CLASS DEFINITION
56
//
57
//=================================================================================================
58
59
//*************************************************************************************************
61
template
<
typename
>
struct
DeclDiagTrait
;
62
template
<
typename
,
typename
=
void
>
struct
DeclDiagTraitEval;
64
//*************************************************************************************************
65
66
67
//*************************************************************************************************
69
template
<
typename
T >
70
auto
evalDeclDiagTrait(
const
volatile
T& ) -> DeclDiagTraitEval<T>;
72
//*************************************************************************************************
73
74
75
//*************************************************************************************************
124
template
<
typename
MT >
// Type of the matrix
125
struct
DeclDiagTrait
126
:
public
decltype( evalDeclDiagTrait( std::declval<MT&>() ) )
127
{};
128
//*************************************************************************************************
129
130
131
//*************************************************************************************************
144
template
<
typename
MT >
// Type of the matrix
145
using
DeclDiagTrait_t
=
typename
DeclDiagTrait<MT>::Type
;
146
//*************************************************************************************************
147
148
149
//*************************************************************************************************
154
template
<
typename
MT
// Type of the matrix
155
,
typename
>
// Restricting condition
156
struct
DeclDiagTraitEval
157
{};
159
//*************************************************************************************************
160
161
162
//*************************************************************************************************
167
template
<
typename
MT >
// Type of the matrix
168
struct
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
EnableIf.h
Header file for the EnableIf class template.
InvalidType.h
Utility type for generic codes.
IsMatrix.h
Header file for the IsMatrix type trait.
BaseTemplate.h
Header file for the implementation of the base template of the DiagonalMatrix.
blaze::DeclDiagTrait_t
typename DeclDiagTrait< MT >::Type DeclDiagTrait_t
Auxiliary alias declaration for the DeclDiagTrait type trait.
Definition
DeclDiagTrait.h:145
blaze::Size_v
constexpr ptrdiff_t Size_v
Auxiliary variable template for the Size type trait.
Definition
Size.h:176
blaze::DefaultSize_v
constexpr ptrdiff_t DefaultSize_v
Default size of the Size type trait.
Definition
Size.h:72
blaze::IsMatrix_v
constexpr bool IsMatrix_v
Auxiliary variable template for the IsMatrix type trait.
Definition
IsMatrix.h:124
blaze::EnableIf_t
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition
EnableIf.h:138
Size.h
Header file for the Size type trait.
blaze::DeclDiagTrait
Base template for the DeclDiagTrait class.
Definition
DeclDiagTrait.h:127
Generated by
1.18.0