Loading [MathJax]/extensions/TeX/AMSsymbols.js
Template Numerical Library version\ main:ab3532f7
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Function objects for reduction operations

Classes

struct  TNL::BitAnd
 Extension of std::bit_and<void> for use with TNL::Algorithms::reduce. More...
 
struct  TNL::BitOr
 Extension of std::bit_or<void> for use with TNL::Algorithms::reduce. More...
 
struct  TNL::BitXor
 Extension of std::bit_xor<void> for use with TNL::Algorithms::reduce. More...
 
struct  TNL::LogicalAnd
 Function object implementing x && y. More...
 
struct  TNL::LogicalOr
 Function object implementing x || y. More...
 
struct  TNL::Max
 Function object implementing max(x, y). More...
 
struct  TNL::Min
 Function object implementing min(x, y). More...
 
struct  TNL::Multiplies
 Function object implementing x * y. More...
 
struct  TNL::Plus
 Function object implementing x + y. More...
 

Detailed Description

Reduction function objects are used in reduction operations in TNL, such as TNL::Algorithms::reduce but also in reduction in TNL::Algorithms::Segments and TNL::Matrices.

In general, each reduction operation is implemented as a generic operator() of the form auto operator()( T1 x, T2 y ) const -> T3, which computes an appropriate associative and commutative binary operation. Furthermore, the reduction function objects in TNL extend the corresponding STL function objects with a getIdentity() method, which returns the identity element for the operation. The identity element is a value that does not change the result of the operation when combined with any other value.