54 template<
typename dtype>
63 double meanValue =
nanmean(inArray, inAxis).item();
66 for (
auto value : inArray)
84 for (
uint32 row = 0; row < inShape.
rows; ++row)
88 for (
uint32 col = 0; col < inShape.
cols; ++col)
95 sum +=
utils::sqr(
static_cast<double>(inArray(row, col)) - meanValue[row]);
107 const Shape inShape = transposedArray.
shape();
109 for (
uint32 row = 0; row < inShape.
rows; ++row)
113 for (
uint32 col = 0; col < inShape.
cols; ++col)
120 sum +=
utils::sqr(
static_cast<double>(transposedArray(row, col)) - meanValue[row]);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:43
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4483
NdArray< dtype > transpose() const
Definition: NdArrayCore.hpp:4841
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
uint32 rows
Definition: Core/Shape.hpp:44
uint32 cols
Definition: Core/Shape.hpp:45
constexpr dtype sqr(dtype inValue) noexcept
Definition: sqr.hpp:44
Definition: Coordinate.hpp:45
NdArray< double > nanstdev(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: nanstdev.hpp:55
Axis
Enum To describe an axis.
Definition: Types.hpp:46
auto sqrt(dtype inValue) noexcept
Definition: sqrt.hpp:50
NdArray< dtype > sum(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: sum.hpp:47
bool isnan(dtype inValue) noexcept
Definition: isnan.hpp:51
NdArray< double > nanmean(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: nanmean.hpp:55
std::uint32_t uint32
Definition: Types.hpp:40