Skip to content

num::kernel::norm_sq

Defined in header <kernel/vector.hpp>

template <std::floating_point T>
T norm_sq(const T *x, idx n) noexcept;

Computes squared Euclidean norm \(\|\mathbf{x}\|_2^2 = \sum_{i=0}^{n-1} x_i^2\).