55 template<
typename dtype>
64 auto sum =
static_cast<double>(std::accumulate(inArray.
cbegin(), inArray.
cend(), 0.0,
65 [](dtype inValue1, dtype inValue2) -> dtype
67 return std::isnan(inValue2) ? inValue1 : inValue1 + inValue2;
70 const auto numberNonNan =
static_cast<double>(std::accumulate(inArray.
cbegin(), inArray.
cend(), 0.0,
71 [](dtype inValue1, dtype inValue2) -> dtype
73 return std::isnan(inValue2) ? inValue1 : inValue1 + 1;
84 for (
uint32 row = 0; row < inShape.
rows; ++row)
86 auto sum =
static_cast<double>(std::accumulate(inArray.
cbegin(row), inArray.
cend(row), 0.0,
87 [](dtype inValue1, dtype inValue2) -> dtype
89 return std::isnan(inValue2) ? inValue1 : inValue1 + inValue2;
92 auto numberNonNan =
static_cast<double>(std::accumulate(inArray.
cbegin(row), inArray.
cend(row), 0.0,
93 [](dtype inValue1, dtype inValue2) -> dtype
95 return std::isnan(inValue2) ? inValue1 : inValue1 + 1;
98 returnArray(0, row) =
sum / numberNonNan;
106 const Shape transShape = transposedArray.
shape();
108 for (
uint32 row = 0; row < transShape.
rows; ++row)
110 auto sum =
static_cast<double>(std::accumulate(transposedArray.
cbegin(row), transposedArray.
cend(row), 0.0,
111 [](dtype inValue1, dtype inValue2) -> dtype
113 return std::isnan(inValue2) ? inValue1 : inValue1 + inValue2;
116 auto numberNonNan =
static_cast<double>(std::accumulate(transposedArray.
cbegin(row), transposedArray.
cend(row), 0.0,
117 [](dtype inValue1, dtype inValue2) -> dtype
119 return std::isnan(inValue2) ? inValue1 : inValue1 + 1;
122 returnArray(0, row) =
sum / numberNonNan;