Blaze 3.9
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>
50#include <blaze/util/EnableIf.h>
51
52
53namespace blaze {
54
55//=================================================================================================
56//
57// CLASS DEFINITION
58//
59//=================================================================================================
60
61//*************************************************************************************************
63template< typename > struct DeclZeroTrait;
64template< typename, typename = void > struct DeclZeroTraitEval;
66//*************************************************************************************************
67
68
69//*************************************************************************************************
71template< typename T >
72auto evalDeclZeroTrait( const volatile T& ) -> DeclZeroTraitEval<T>;
74//*************************************************************************************************
75
76
77//*************************************************************************************************
127template< typename T > // Type of the vector or matrix
129 : public decltype( evalDeclZeroTrait( std::declval<T&>() ) )
130{};
131//*************************************************************************************************
132
133
134//*************************************************************************************************
147template< typename T > // Type of the matrix
149//*************************************************************************************************
150
151
152//*************************************************************************************************
157template< typename T // Type of the vector or matrix
158 , typename > // Restricting condition
159struct DeclZeroTraitEval
160{};
162//*************************************************************************************************
163
164
165//*************************************************************************************************
170template< typename T > // Type of the vector
171struct DeclZeroTraitEval< T
172 , EnableIf_t< IsVector_v<T> > >
173{
174 using Type = ZeroVector< typename T::ElementType, TransposeFlag_v<T> >;
175};
177//*************************************************************************************************
178
179
180//*************************************************************************************************
185template< typename T > // Type of the matrix
186struct 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
Header file for the EnableIf class template.
Header file for the IsMatrix type trait.
Header file for the IsVector type trait.
typename DeclZeroTrait< T >::Type DeclZeroTrait_t
Auxiliary alias declaration for the DeclZeroTrait type trait.
Definition: DeclZeroTrait.h:148
constexpr bool IsVector_v
Auxiliary variable template for the IsVector type trait.
Definition: IsVector.h:125
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 all forward declarations for sparse vectors and matrices.
Header file for the Size type trait.
Header file for the StorageOrder type trait.
Header file for the TransposeFlag type trait.
Base template for the DeclZeroTrait class.
Definition: DeclZeroTrait.h:130