51 template<
typename dtype>
60 auto sum = std::accumulate(inArray.
cbegin(), inArray.
cend(), 0.);
70 auto sum = std::accumulate(inArray.
cbegin(row), inArray.
cend(row), 0.);
71 returnArray(0, row) =
sum /
static_cast<double>(inArray.
numCols());
99 template<
typename dtype>
108 auto sum = std::accumulate(inArray.cbegin(), inArray.cend(), std::complex<double>(0.));
116 for (
uint32 row = 0; row < inArray.numRows(); ++row)
118 auto sum = std::accumulate(inArray.cbegin(row), inArray.cend(row), std::complex<double>(0.));
119 returnArray(0, row) =
sum / std::complex<double>(inArray.numCols());
130 auto sum = std::accumulate(transposedArray.
cbegin(row),
131 transposedArray.
cend(row),
132 std::complex<double>(0.));
133 returnArray(0, row) =
sum / std::complex<double>(transposedArray.
numCols());
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
size_type size() const noexcept
Definition: NdArrayCore.hpp:4524
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
self_type transpose() const
Definition: NdArrayCore.hpp:4882
size_type numCols() const noexcept
Definition: NdArrayCore.hpp:3465
size_type numRows() const noexcept
Definition: NdArrayCore.hpp:3477
const_iterator cend() const noexcept
Definition: NdArrayCore.hpp:1673
Definition: Cartesian.hpp:40
NdArray< double > mean(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: mean.hpp:52
Axis
Enum To describe an axis.
Definition: Enums.hpp:36
NdArray< dtype > sum(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: sum.hpp:46
std::uint32_t uint32
Definition: Types.hpp:40