![]() |
Blaze 3.9
|
Base template for the ReduceTrait class. More...
#include <ReduceTrait.h>
Inherits decltype evalReduceTrait std::declval< T & >, and std::declval< OP >.
Base template for the ReduceTrait class.
The ReduceTrait class template offers the possibility to select the resulting data type of a generic reduction operation on the given type T. ReduceTrait defines the nested type Type, which represents the resulting data type of the reduction operation. In case no result type can be determined for the type T, there is no nested type Type. Note that const
and volatile
qualifiers and reference modifiers are generally ignored.
ReduceTrait is guaranteed to work for all vector and matrix types of the Blaze library (including views and adaptors) and all data types that work in combination with the provided reduction operation OP. In order to add support for user-defined data types or in order to adapt to special cases it is possible to specialize the ReduceTrait template. The following examples shows the according specialization for total and partial reduction operations with a dynamic matrix, respectively: