ENH: FieldFunctions reduce on returnType, not input type (#1327)

- for most functions the input type and return type are identical,
  but MinMax, sumMag are not.
This commit is contained in:
Mark Olesen
2019-05-28 14:48:18 +02:00
committed by Andrew Heather
parent 7945ca739c
commit 26a6533053
8 changed files with 52 additions and 58 deletions

View File

@ -227,6 +227,7 @@ Type average(const UList<Type>& f);
TMP_UNARY_FUNCTION(Type, average)
// With reduction on ReturnType
#define G_UNARY_FUNCTION(ReturnType, gFunc, Func, rFunc) \
\
template<class Type> \
@ -238,12 +239,13 @@ G_UNARY_FUNCTION(Type, gMin, min, min)
G_UNARY_FUNCTION(Type, gSum, sum, sum)
G_UNARY_FUNCTION(Type, gMaxMagSqr, maxMagSqr, maxMagSqr)
G_UNARY_FUNCTION(Type, gMinMagSqr, minMagSqr, minMagSqr)
G_UNARY_FUNCTION(scalar, gSumSqr, sumSqr, sum)
G_UNARY_FUNCTION(scalar, gSumMag, sumMag, sum)
G_UNARY_FUNCTION(Type, gSumCmptMag, sumCmptMag, sum)
G_UNARY_FUNCTION(MinMax<Type>, gMinMax, minMax, minMax)
G_UNARY_FUNCTION(scalarMinMax, gMinMaxMag, minMaxMag, minMaxMag)
G_UNARY_FUNCTION(MinMax<Type>, gMinMax, minMax, sum)
G_UNARY_FUNCTION(scalarMinMax, gMinMaxMag, minMaxMag, sum)
G_UNARY_FUNCTION(scalar, gSumSqr, sumSqr, sum)
G_UNARY_FUNCTION(scalar, gSumMag, sumMag, sum)
#undef G_UNARY_FUNCTION