MinMaxScalar

MinMaxScalar is a class template that stores both a minimum and a maximum value as a single, convenient unit. It is primarily designed to hold the result of parallel_reduce() operations using the MinMax builtin reducer.

It is generally recommended to get this type by using the reducer’s ::value_type member (e.g., MinMax<Scalar,Space>::value_type) to ensure the correct template parameters are used.

Header File: <Kokkos_Core.hpp>

Usage

MinMax<T,S>::value_type result;
parallel_reduce(N,Functor,MinMax<T,S>(result));
T minValue = result.min_val;
T maxValue = result.max_val;

Interface

template<class Scalar>
struct MinMaxScalar
Template Parameters:

Scalar – The data type of the value being reduced (e.g., double, int).

Data members

Scalar min_val

The reduced minimum value.

Scalar max_val

The reduced maximum value.