Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
traits
DeclIdTrait.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TRAITS_DECLIDTRAIT_H_
36
#define _BLAZE_MATH_TRAITS_DECLIDTRAIT_H_
37
38
39
//*************************************************************************************************
40
// Includes
41
//*************************************************************************************************
42
43
#include <utility>
44
#include <
blaze/math/sparse/Forward.h
>
45
#include <
blaze/math/typetraits/IsMatrix.h
>
46
#include <
blaze/math/typetraits/Size.h
>
47
#include <
blaze/math/typetraits/StorageOrder.h
>
48
#include <
blaze/util/EnableIf.h
>
49
50
51
namespace
blaze {
52
53
//=================================================================================================
54
//
55
// CLASS DEFINITION
56
//
57
//=================================================================================================
58
59
//*************************************************************************************************
61
template
<
typename
>
struct
DeclIdTrait
;
62
template
<
typename
,
typename
=
void
>
struct
DeclIdTraitEval;
64
//*************************************************************************************************
65
66
67
//*************************************************************************************************
69
template
<
typename
T >
70
auto
evalDeclIdTrait(
const
volatile
T& ) -> DeclIdTraitEval<T>;
72
//*************************************************************************************************
73
74
75
//*************************************************************************************************
124
template
<
typename
MT >
// Type of the matrix
125
struct
DeclIdTrait
126
:
public
decltype( evalDeclIdTrait( std::declval<MT&>() ) )
127
{};
128
//*************************************************************************************************
129
130
131
//*************************************************************************************************
144
template
<
typename
MT >
// Type of the matrix
145
using
DeclIdTrait_t
=
typename
DeclIdTrait<MT>::Type
;
146
//*************************************************************************************************
147
148
149
//*************************************************************************************************
154
template
<
typename
MT
// Type of the matrix
155
,
typename
>
// Restricting condition
156
struct
DeclIdTraitEval
157
{};
159
//*************************************************************************************************
160
161
162
//*************************************************************************************************
167
template
<
typename
MT >
// Type of the matrix
168
struct
DeclIdTraitEval< 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 = IdentityMatrix< typename MT::ElementType, StorageOrder_v<MT> >;
175
};
177
//*************************************************************************************************
178
179
}
// namespace blaze
180
181
#endif
EnableIf.h
Header file for the EnableIf class template.
IsMatrix.h
Header file for the IsMatrix type trait.
blaze::DeclIdTrait_t
typename DeclIdTrait< MT >::Type DeclIdTrait_t
Auxiliary alias declaration for the DeclIdTrait type trait.
Definition
DeclIdTrait.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
Forward.h
Header file for all forward declarations for sparse vectors and matrices.
Size.h
Header file for the Size type trait.
StorageOrder.h
Header file for the StorageOrder type trait.
blaze::DeclIdTrait
Base template for the DeclIdTrait class.
Definition
DeclIdTrait.h:127
Generated by
1.18.0