Dense row-major matrix with optional GPU storage.
void axpy(real alpha, const Vector &x, Vector &y)
void matmul(const Matrix &A, const Matrix &B, Matrix &C)
real dot(const Vector &x, const Vector &y)
void matvec(const Matrix &A, const Vector &x, Vector &y)
real norm(const Vector &x)
void scale(Vector &v, real alpha)
constexpr T ipow(T x) noexcept
Compute x^N at compile time via repeated squaring.