Blaze 3.9
blaze::RepeatTrait< T, CRAs > Struct Template Reference

Base template for the RepeatTrait class. More...

#include <RepeatTrait.h>

Inherits decltype evalRepeatTrait std::declval< T & >.

Detailed Description

template<typename T, size_t... CRAs>
struct blaze::RepeatTrait< T, CRAs >

Base template for the RepeatTrait class.

General

The RepeatTrait class template offers the possibility to select the resulting data type when repeating a dense or sparse vector or matrix. RepeatTrait defines the nested type Type, which represents the resulting data type of the repeat operation. In case the given data type is not a dense or sparse vector or matrix type, there is no nested type Type. Note that const and volatile qualifiers and reference modifiers are generally ignored.

Creating custom specializations

Per default, RepeatTrait 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 RepeatTrait template. The following example shows the according specialization for the DynamicVector class template:

template< typename Type, bool TF, size_t... CRAs >
struct RepeatTrait< DynamicVector<Type,TF>, CRAs... >
{
using Type = DynamicVector<Type,TF>;
};


Examples

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

// Definition of the resulting type of a dynamic column vector
using ResultType1 = typename blaze::RepeatTrait<VectorType1>::Type;
// Definition of the resulting type of a static row vector
using ResultType2 = typename blaze::RepeatTrait<VectorType2>::Type;
Efficient implementation of an arbitrary sized vector.
Definition: DynamicVector.h:223
Efficient implementation of a fixed-sized vector.
Definition: StaticVector.h:230
constexpr bool columnVector
Transpose flag for column vectors.
Definition: TransposeFlag.h:58
constexpr bool rowVector
Transpose flag for row vectors.
Definition: TransposeFlag.h:73
Base template for the RepeatTrait class.
Definition: RepeatTrait.h:132

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