blaze::BandTrait< MT, CBAs > Struct Template Reference

Base template for the BandTrait class. More...

#include <BandTrait.h>

Detailed Description

template<typename MT, ptrdiff_t... CBAs>
struct blaze::BandTrait< MT, CBAs >

Base template for the BandTrait class.

General

The BandTrait class template offers the possibility to select the resulting data type when creating a view on a specific band of a dense or sparse matrix. BandTrait defines the nested type Type, which represents the resulting data type of the band operation. In case the given data type is not a dense or sparse matrix type, the resulting data type Type is set to INVALID_TYPE. Note that const and volatile qualifiers and reference modifiers are generally ignored.

Creating custom specializations

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

template< typename T1, bool SO, ptrdiff_t... CBAs >
struct BandTrait< DynamicMatrix<T1,SO>, CBAs... >
{
using Type = DynamicVector<T1,true>;
};


Examples

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

// Definition of the fitting type for any band of a row-major dynamic matrix
using ResultType1 = typename blaze::BandTrait<MatrixType1>::Type;
// Definition of the fitting type of the 3rd band of a column-major static matrix
using ResultType2 = typename blaze::BandTrait<MatrixType2,3L>::Type;

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