Skip to content

num::kernel::norm

Defined in header <kernel/vector.hpp>

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

Compute the Euclidean norm: \(\|x\|_2\). Rescales to avoid overflow and underflow.