50 template<
typename dtype>
55 double squareSum = 0.;
56 const auto function = [&squareSum](dtype value) ->
void
57 { squareSum +=
utils::sqr(
static_cast<double>(value)); };
74 returnArray(0, row) =
std::sqrt(squareSum /
static_cast<double>(inArray.
numCols()));
100 template<
typename dtype>
105 std::complex<double> squareSum = 0.;
106 const auto function = [&squareSum](std::complex<dtype> value) ->
void
107 { squareSum +=
utils::sqr(complex_cast<double>(value)); };
115 static_cast<double>(inArray.size())) };
121 for (
uint32 row = 0; row < inArray.numRows(); ++row)
123 squareSum = std::complex<double>(0., 0.);
124 std::for_each(inArray.cbegin(row), inArray.cend(row), function);
125 returnArray(0, row) =
std::sqrt(squareSum /
static_cast<double>(inArray.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
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:225
constexpr dtype sqr(dtype inValue) noexcept
Definition: sqr.hpp:42
Definition: Cartesian.hpp:40
Axis
Enum To describe an axis.
Definition: Enums.hpp:36
auto sqrt(dtype inValue) noexcept
Definition: sqrt.hpp:48
NdArray< double > rms(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: rms.hpp:51
std::uint32_t uint32
Definition: Types.hpp:40