14 for (
idx i = 0; i < x.
size(); ++i)
constexpr idx size() const noexcept
real dot(const Vector &x, const Vector &y)
void scale(Vector &v, real alpha)
real norm(const Vector &x)
void add(const Vector &x, const Vector &y, Vector &z)
void axpy(real alpha, const Vector &x, Vector &y)
NUM_K_AINLINE T dot(const T *NUM_K_RESTRICT x, const T *NUM_K_RESTRICT y, idx n) noexcept
dot product: return sum x[i] * y[i]
NUM_K_AINLINE void axpy(T *NUM_K_RESTRICT y, const T *NUM_K_RESTRICT x, T alpha, idx n) noexcept
y[i] += alpha * x[i]
NUM_K_AINLINE T norm(const T *NUM_K_RESTRICT x, idx n) noexcept
Euclidean norm: sqrt(sum x[i]^2)
NUM_K_AINLINE void scale(T *NUM_K_RESTRICT x, T alpha, idx n) noexcept
x[i] *= alpha
Tier-1 kernel: raw-pointer, inline, zero-overhead inner loops.
Dense vector storage and operations.