blaze::MathTrait< T1, T2 > Struct Template Reference

Base template for the MathTrait class. More...

#include <MathTrait.h>

Detailed Description

template<typename T1, typename T2>
struct blaze::MathTrait< T1, T2 >

Base template for the MathTrait class.

General

The MathTrait class template determines the more significant, dominating data type and the less significant, submissive data type of the two given data types T1 and T2. The more significant data type is represented by the nested type HighType, the less significant data type by the nested type LowType. For instance, in case both T1 and T2 are built-in data types, HighType is set to the larger or signed data type and LowType is set to the smaller or unsigned data type. In case no dominating data type can be selected, Type is set to INVALID_TYPE. Note that const and volatile qualifiers and reference modifiers are generally ignored.

Per default, the MathTrait template provides specializations for the following built-in data types:

Additionally, the Blaze library provides specializations for the following user-defined arithmetic types, wherever a more/less significant data type can be selected:


Creating custom specializations

It is possible to specialize the MathTrait template for additional user-defined data types. The following example shows the according specialization for two dynamic column vectors:

template< typename T1, typename T2 >
struct MathTrait< DynamicVector<T1,false>, DynamicVector<T2,false> >
{
typedef DynamicVector< typename MathTrait<T1,T2>::Type, false > Type;
};

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