Blaze 3.9
Loading...
Searching...
No Matches
blaze::DeclZeroTrait< T > Struct Template Reference

Base template for the DeclZeroTrait class. More...

#include <DeclZeroTrait.h>

Detailed Description

template<typename T>
struct blaze::DeclZeroTrait< T >

Base template for the DeclZeroTrait class.

General

The DeclZeroTrait class template offers the possibility to select the resulting data type of a generic declzero() operation on the given type T. In case the given type T is a fitting data type, DeclZeroTrait defines the nested type Type, which represents the resulting data type of the declzero() operation. Otherwise there is no nested type Type. Note that const and volatile qualifiers and reference modifiers are generally ignored.

Creating custom specializations

Per default, DeclZeroTrait supports all vector and matrix types of the Blaze library (including views and adaptors). For all other data types it is possible to specialize the DeclZeroTrait template. The following example shows the according specialization for the SymmetricMatrix class template:

template< typename MT, bool SO, bool DF, bool SF >
struct DeclZeroTrait< SymmetricMatrix<MT,SO,DF,SF> >
{
};
Matrix adapter for symmetric matrices.
Definition BaseTemplate.h:614
Efficient implementation of an zero matrix.
Definition ZeroMatrix.h:197
Base template for the DeclZeroTrait class.
Definition DeclZeroTrait.h:130


Examples

The following example demonstrates the use of the DeclZeroTrait template, where depending on the given vector or matrix type the resulting type is selected:

// Definition of the resulting type of a row-major dynamic matrix
using VectorType = DynamicVector<int,rowVector>;
using DeclZeroType1 = typename DeclZeroTrait<VectorType>::Type;
// Definition of the resulting type of a symmetric column-major static matrix
using DeclZeroType2 = typename DeclZeroTrait<MatrixType>::Type;
Efficient implementation of an arbitrary sized vector.
Definition DynamicVector.h:223
Efficient implementation of a fixed-sized matrix.
Definition StaticMatrix.h:249
constexpr bool columnMajor
Storage order flag for column-major matrices.
Definition StorageOrder.h:99
constexpr bool rowVector
Transpose flag for row vectors.
Definition TransposeFlag.h:73

The documentation for this struct was generated from the following file: