22 raw::ger(A.data(), x.data(), y.data(), alpha, x.size(), y.size());
26#ifdef NUMERICS_HAS_OMP
32 #pragma omp parallel for schedule(static)
33 for (
idx i = 0; i < m; ++i) {
34 const real axi = alpha * xd[i];
35 real* row = Ad + (i * n);
36 for (
idx j = 0; j < n; ++j) {
37 row[j] += axi * yd[j];
51 if (L.
cols() != n || b.
size() != n) {
52 throw std::invalid_argument(
"kernel::dense::trsv_lower: dimension mismatch");
66 if (U.
cols() != n || b.
size() != n) {
67 throw std::invalid_argument(
"kernel::dense::trsv_upper: dimension mismatch");
constexpr idx size() const noexcept
Dense row-major matrix with optional GPU storage.
constexpr idx rows() const noexcept
constexpr idx cols() const noexcept
Dense matrix inner kernels (namespace num::kernel::dense)
void trsv_upper(const Matrix &U, const Vector &b, Vector &x)
Back substitution: solve Ux = b.
void trsv_lower(const Matrix &L, const Vector &b, Vector &x)
Forward substitution: solve Lx = b.
void ger(real alpha, const Vector &x, const Vector &y, Matrix &A, seq_t) noexcept
Sequential rank-1 update: calls raw::ger (routes to cblas_dger when BLAS available; otherwise vectori...
NUM_K_AINLINE void ger(real *NUM_K_RESTRICT A, const real *NUM_K_RESTRICT x, const real *NUM_K_RESTRICT y, real alpha, idx m, idx n) noexcept
Rank-1 update: A[i*n + j] += alpha * x[i] * y[j] (m x n row-major)
NUM_K_AINLINE void trsv_lower(real *NUM_K_RESTRICT x, const real *NUM_K_RESTRICT L, const real *NUM_K_RESTRICT b, idx n) noexcept
Forward substitution: solve Lx = b, L lower triangular (n x n, row-major).
NUM_K_AINLINE void trsv_upper(real *NUM_K_RESTRICT x, const real *NUM_K_RESTRICT U, const real *NUM_K_RESTRICT b, idx n) noexcept
Back substitution: solve Ux = b, U upper triangular (n x n, row-major).
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
Tier-1 kernel: raw-pointer, inline, zero-overhead inner loops.
Parallel execution policy tag. Activates OMP parallel-for / reduction constructs when NUMERICS_HAS_OM...
Sequential execution policy tag. Guarantees no OMP parallel regions; safe to call inside an existing ...