Reducer Class Referenceabstract

Abstract class for all reducer algorithms. More...

#include <Reducer.h>

Inheritance diagram for Reducer:
ReducerAll ReducerAny ReducerArgmax ReducerArgmin ReducerCount ReducerCountNonzero ReducerMax ReducerMin ReducerProd ReducerSum

Public Member Functions

virtual const std::string name () const =0
 Name of the reducer algorithm. More...
 
virtual util::dtype preferred_dtype () const =0
 Data type to prefer, as a NumPy dtype, if the array has UnknownType. More...
 
virtual util::dtype return_dtype (util::dtype given_dtype) const
 Return type for a given_dtype as a NumPy dtype. More...
 
virtual bool returns_positions () const
 True if this reducer returns index positions; false otherwise. More...
 
virtual const std::shared_ptr< void > apply_bool (const bool *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of boolean values. More...
 
virtual const std::shared_ptr< void > apply_int8 (const int8_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of signed 8-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_uint8 (const uint8_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of unsigned 8-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_int16 (const int16_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of signed 16-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_uint16 (const uint16_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of unsigned 16-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_int32 (const int32_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of signed 32-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_uint32 (const uint32_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of unsigned 32-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_int64 (const int64_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of signed 64-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_uint64 (const uint64_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of unsigned 64-bit integer values. More...
 
virtual const std::shared_ptr< void > apply_float32 (const float *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of 32-bit floating-point values. More...
 
virtual const std::shared_ptr< void > apply_float64 (const double *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of 64-bit floating-point values. More...
 
virtual const std::shared_ptr< void > apply_complex64 (const std::complex< float > *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of complex 32-bit floating-point values. More...
 
virtual const std::shared_ptr< void > apply_complex128 (const std::complex< double > *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of complex 64-bit floating-point values. More...
 
virtual const std::shared_ptr< void > apply_datetime (const int64_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of datetime values. More...
 
virtual const std::shared_ptr< void > apply_timedelta (const int64_t *data, const Index64 &parents, int64_t outlength) const =0
 Apply the reducer algorithm to an array of timedelta values. More...
 

Detailed Description

Abstract class for all reducer algorithms.

Reducers have no parameters or state. They are classes for convenience, to separate Content::reduce_next, determining which values to combine, from the choice of reducer algorithm.

Member Function Documentation

◆ apply_bool()

virtual const std::shared_ptr<void> apply_bool ( const bool *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of boolean values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_complex128()

virtual const std::shared_ptr<void> apply_complex128 ( const std::complex< double > *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of complex 64-bit floating-point values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_complex64()

virtual const std::shared_ptr<void> apply_complex64 ( const std::complex< float > *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of complex 32-bit floating-point values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_datetime()

virtual const std::shared_ptr<void> apply_datetime ( const int64_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of datetime values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_float32()

virtual const std::shared_ptr<void> apply_float32 ( const float *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of 32-bit floating-point values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_float64()

virtual const std::shared_ptr<void> apply_float64 ( const double *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of 64-bit floating-point values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_int16()

virtual const std::shared_ptr<void> apply_int16 ( const int16_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of signed 16-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_int32()

virtual const std::shared_ptr<void> apply_int32 ( const int32_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of signed 32-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_int64()

virtual const std::shared_ptr<void> apply_int64 ( const int64_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of signed 64-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_int8()

virtual const std::shared_ptr<void> apply_int8 ( const int8_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of signed 8-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_timedelta()

virtual const std::shared_ptr<void> apply_timedelta ( const int64_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of timedelta values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_uint16()

virtual const std::shared_ptr<void> apply_uint16 ( const uint16_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of unsigned 16-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_uint32()

virtual const std::shared_ptr<void> apply_uint32 ( const uint32_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of unsigned 32-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_uint64()

virtual const std::shared_ptr<void> apply_uint64 ( const uint64_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of unsigned 64-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ apply_uint8()

virtual const std::shared_ptr<void> apply_uint8 ( const uint8_t *  data,
const Index64 parents,
int64_t  outlength 
) const
pure virtual

Apply the reducer algorithm to an array of unsigned 8-bit integer values.

Parameters
dataThe array to reduce.
parentsAn integer array indicating which group each element belongs to.
outlengthThe length of the output array (equal to the number of groups).

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ name()

virtual const std::string name ( ) const
pure virtual

◆ preferred_dtype()

virtual util::dtype preferred_dtype ( ) const
pure virtual

Data type to prefer, as a NumPy dtype, if the array has UnknownType.

Implemented in ReducerArgmax, ReducerArgmin, ReducerMax, ReducerMin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ return_dtype()

virtual util::dtype return_dtype ( util::dtype  given_dtype) const
virtual

Return type for a given_dtype as a NumPy dtype.

Reimplemented in ReducerArgmax, ReducerArgmin, ReducerAll, ReducerAny, ReducerProd, ReducerSum, ReducerCountNonzero, and ReducerCount.

◆ returns_positions()

virtual bool returns_positions ( ) const
virtual

True if this reducer returns index positions; false otherwise.

Reimplemented in ReducerArgmax, and ReducerArgmin.


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