Blaze
3.9
Toggle main menu visibility
Loading...
Searching...
No Matches
blaze
math
traits
DeclZeroTrait.h
Go to the documentation of this file.
1
//=================================================================================================
33
//=================================================================================================
34
35
#ifndef _BLAZE_MATH_TRAITS_DECLZEROTRAIT_H_
36
#define _BLAZE_MATH_TRAITS_DECLZEROTRAIT_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/IsVector.h
>
47
#include <
blaze/math/typetraits/Size.h
>
48
#include <
blaze/math/typetraits/StorageOrder.h
>
49
#include <
blaze/math/typetraits/TransposeFlag.h
>
50
#include <
blaze/util/EnableIf.h
>
51
52
53
namespace
blaze {
54
55
//=================================================================================================
56
//
57
// CLASS DEFINITION
58
//
59
//=================================================================================================
60
61
//*************************************************************************************************
63
template
<
typename
>
struct
DeclZeroTrait
;
64
template
<
typename
,
typename
=
void
>
struct
DeclZeroTraitEval;
66
//*************************************************************************************************
67
68
69
//*************************************************************************************************
71
template
<
typename
T >
72
auto
evalDeclZeroTrait(
const
volatile
T& ) -> DeclZeroTraitEval<T>;
74
//*************************************************************************************************
75
76
77
//*************************************************************************************************
127
template
<
typename
T >
// Type of the vector or matrix
128
struct
DeclZeroTrait
129
:
public
decltype( evalDeclZeroTrait( std::declval<T&>() ) )
130
{};
131
//*************************************************************************************************
132
133
134
//*************************************************************************************************
147
template
<
typename
T >
// Type of the matrix
148
using
DeclZeroTrait_t
=
typename
DeclZeroTrait<T>::Type
;
149
//*************************************************************************************************
150
151
152
//*************************************************************************************************
157
template
<
typename
T
// Type of the vector or matrix
158
,
typename
>
// Restricting condition
159
struct
DeclZeroTraitEval
160
{};
162
//*************************************************************************************************
163
164
165
//*************************************************************************************************
170
template
<
typename
T >
// Type of the vector
171
struct
DeclZeroTraitEval< T
172
,
EnableIf_t
<
IsVector_v
<T> > >
173
{
174
using
Type = ZeroVector< typename T::ElementType, TransposeFlag_v<T> >;
175
};
177
//*************************************************************************************************
178
179
180
//*************************************************************************************************
185
template
<
typename
T >
// Type of the matrix
186
struct
DeclZeroTraitEval< T
187
,
EnableIf_t
<
IsMatrix_v
<T> > >
188
{
189
using
Type = ZeroMatrix< typename T::ElementType, StorageOrder_v<T> >;
190
};
192
//*************************************************************************************************
193
194
}
// namespace blaze
195
196
#endif
EnableIf.h
Header file for the EnableIf class template.
IsMatrix.h
Header file for the IsMatrix type trait.
IsVector.h
Header file for the IsVector type trait.
blaze::DeclZeroTrait_t
typename DeclZeroTrait< T >::Type DeclZeroTrait_t
Auxiliary alias declaration for the DeclZeroTrait type trait.
Definition
DeclZeroTrait.h:148
blaze::IsVector_v
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.
Definition
IsVector.h:125
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.
TransposeFlag.h
Header file for the TransposeFlag type trait.
blaze::DeclZeroTrait
Base template for the DeclZeroTrait class.
Definition
DeclZeroTrait.h:130
Generated by
1.18.0