50 template<
typename dtype>
55 double sumOfSquares = 0.;
56 const auto function = [&sumOfSquares](dtype value) ->
void
57 { sumOfSquares +=
utils::sqr(
static_cast<double>(value)); };
75 returnArray(0, row) =
std::sqrt(sumOfSquares);
101 template<
typename dtype>
106 std::complex<double> sumOfSquares(0., 0.);
107 const auto function = [&sumOfSquares](
const std::complex<dtype>& value) ->
void
108 { sumOfSquares +=
utils::sqr(complex_cast<double>(value)); };
122 for (
uint32 row = 0; row < inArray.numRows(); ++row)
124 sumOfSquares = std::complex<double>(0., 0.);
125 std::for_each(inArray.cbegin(row), inArray.cend(row), function);
126 returnArray(0, row) =
std::sqrt(sumOfSquares);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:39
const_iterator cbegin() const noexcept
Definition: NdArrayCore.hpp:1365
self_type transpose() const
Definition: NdArrayCore.hpp:4882
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
NdArray< double > norm(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: norm.hpp:51
Axis
Enum To describe an axis.
Definition: Enums.hpp:36
auto sqrt(dtype inValue) noexcept
Definition: sqrt.hpp:48
std::uint32_t uint32
Definition: Types.hpp:40