Class MHO_Reducer.
More...
#include <MHO_Reducer.hh>
|
using | XItemType = typename XArrayType::value_type |
|
|
virtual bool | ExecuteInPlace (XArrayType *in) override |
| Executes operation in-place by calling ExecuteOutOfPlace and copying result back to input. More...
|
|
virtual bool | ExecuteOutOfPlace (const XArrayType *in, XArrayType *out) override |
| Function ExecuteOutOfPlace - carries out the array reduction. More...
|
|
virtual bool | InitializeInPlace (XArrayType *in) override |
| Initializes XArrayType in-place by calling InitializeOutOfPlace with given workspace. More...
|
|
virtual bool | InitializeOutOfPlace (const XArrayType *in, XArrayType *out) override |
| Initializes out-of-place operation using input array and workspace. More...
|
|
template<typename XArrayType, template< typename > class XFunctorType>
class hops::MHO_Reducer< XArrayType, XFunctorType >
Class MHO_Reducer.
Reduce a multi-dimensional array via a templated operation (e.g. summation) along the (runtime) specified dimensions. The output array has the same dimensionality (i.e. XArrayType::rank::value). However, the axes over which reduction occured will have a size of 1. The output array will be resized if/as needed.
- Author
- J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
- Date
- Tue Nov 17 16:53:15 2020 -0500
◆ XItemType
template<typename XArrayType , template< typename > class XFunctorType>
◆ MHO_Reducer()
template<typename XArrayType , template< typename > class XFunctorType>
◆ ~MHO_Reducer()
template<typename XArrayType , template< typename > class XFunctorType>
◆ ClearAxisSelection()
template<typename XArrayType , template< typename > class XFunctorType>
De-selects all axes by setting internal flags and arrays to default values (no reduction)
◆ ExecuteInPlace()
template<typename XArrayType , template< typename > class XFunctorType>
virtual bool hops::MHO_Reducer< XArrayType, XFunctorType >::ExecuteInPlace |
( |
XArrayType * |
in | ) |
|
|
inlineoverrideprotectedvirtual |
Executes operation in-place by calling ExecuteOutOfPlace and copying result back to input.
- Parameters
-
in | Input array of type XArrayType* |
- Returns
- Status of execution as boolean
- Note
- This is a virtual function.
Implements hops::MHO_UnaryOperator< XArrayType >.
◆ ExecuteOutOfPlace()
template<typename XArrayType , template< typename > class XFunctorType>
virtual bool hops::MHO_Reducer< XArrayType, XFunctorType >::ExecuteOutOfPlace |
( |
const XArrayType * |
in, |
|
|
XArrayType * |
out |
|
) |
| |
|
inlineoverrideprotectedvirtual |
Function ExecuteOutOfPlace - carries out the array reduction.
- Parameters
-
in | (const XArrayType*) |
out | (XArrayType*) |
- Returns
- Return value (bool)
- Note
- This is a virtual function.
Implements hops::MHO_UnaryOperator< XArrayType >.
◆ InitializeInPlace()
template<typename XArrayType , template< typename > class XFunctorType>
virtual bool hops::MHO_Reducer< XArrayType, XFunctorType >::InitializeInPlace |
( |
XArrayType * |
in | ) |
|
|
inlineoverrideprotectedvirtual |
Initializes XArrayType in-place by calling InitializeOutOfPlace with given workspace.
- Parameters
-
in | Pointer to XArrayType object for initialization |
- Returns
- Boolean indicating success of initialization
- Note
- This is a virtual function.
Implements hops::MHO_UnaryOperator< XArrayType >.
◆ InitializeOutOfPlace()
template<typename XArrayType , template< typename > class XFunctorType>
virtual bool hops::MHO_Reducer< XArrayType, XFunctorType >::InitializeOutOfPlace |
( |
const XArrayType * |
in, |
|
|
XArrayType * |
out |
|
) |
| |
|
inlineoverrideprotectedvirtual |
Initializes out-of-place operation using input array and workspace.
- Parameters
-
in | Input array of type XArrayType |
out | Output array of type XArrayType |
- Returns
- True if initialization is successful, false otherwise
- Note
- This is a virtual function.
Implements hops::MHO_UnaryOperator< XArrayType >.
◆ ReduceAxis()
template<typename XArrayType , template< typename > class XFunctorType>
void hops::MHO_Reducer< XArrayType, XFunctorType >::ReduceAxis |
( |
std::size_t |
axis_index | ) |
|
|
inline |
Sets axis index for reduction operation.
set the indices of the axes over which we run the reduction. This must be set before we can initialize/execute for example for a 3D array, if we wanted to reduce along the last axis only we would call this->ReduceAxis(2), or alternatively if we wanted to reduce along both the first and last axis we would call this->ReduceAxis(0), this->ReduceAxis(2)
- Parameters
-
axis_index | Index of the axis to reduce. |
The documentation for this class was generated from the following file: