|
numerics 0.1.0
|
Functions | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | scale (T *NUM_K_RESTRICT x, T alpha, idx n) noexcept |
| x[i] *= alpha | |
| template<std::floating_point T> | |
| 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] | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | axpby (T *NUM_K_RESTRICT y, const T *NUM_K_RESTRICT x, T a, T b, idx n) noexcept |
| y[i] = a*x[i] + b*y[i]. | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | axpbyz (T *NUM_K_RESTRICT z, const T *NUM_K_RESTRICT x, const T *NUM_K_RESTRICT y, T a, T b, idx n) noexcept |
| z[i] = a*x[i] + b*y[i]. | |
| template<std::floating_point T> | |
| 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] | |
| template<std::floating_point T> | |
| NUM_K_AINLINE T | norm_sq (const T *NUM_K_RESTRICT x, idx n) noexcept |
| sum x[i]^2 (no sqrt; use for convergence checks to avoid sqrt cost) | |
| template<std::floating_point T> | |
| NUM_K_AINLINE T | norm (const T *NUM_K_RESTRICT x, idx n) noexcept |
| Euclidean norm: sqrt(sum x[i]^2) | |
| template<std::floating_point T> | |
| NUM_K_AINLINE T | l1_norm (const T *NUM_K_RESTRICT x, idx n) noexcept |
| L1 norm: sum |x[i]|. | |
| template<std::floating_point T> | |
| NUM_K_AINLINE T | linf_norm (const T *NUM_K_RESTRICT x, idx n) noexcept |
| L-infinity norm: max |x[i]|. | |
| template<std::floating_point T> | |
| NUM_K_AINLINE T | sum (const T *NUM_K_RESTRICT x, idx n) noexcept |
| Scalar sum: return sum x[i]. | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | matvec (T *NUM_K_RESTRICT y, const T *NUM_K_RESTRICT A, const T *NUM_K_RESTRICT x, idx m, idx n) noexcept |
| y[i] = sum_j A[i*n + j] * x[j] (m x n row-major matrix) | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | ger (T *NUM_K_RESTRICT A, const T *NUM_K_RESTRICT x, const T *NUM_K_RESTRICT y, T alpha, idx m, idx n) noexcept |
| Rank-1 update: A[i*n + j] += alpha * x[i] * y[j] (m x n row-major) | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | trsv_lower (T *NUM_K_RESTRICT x, const T *NUM_K_RESTRICT L, const T *NUM_K_RESTRICT b, idx n) noexcept |
| Forward substitution: solve Lx = b, L lower triangular (n x n, row-major). | |
| template<std::floating_point T> | |
| NUM_K_AINLINE void | trsv_upper (T *NUM_K_RESTRICT x, const T *NUM_K_RESTRICT U, const T *NUM_K_RESTRICT b, idx n) noexcept |
| Back substitution: solve Ux = b, U upper triangular (n x n, row-major). | |
|
noexcept |
y[i] = a*x[i] + b*y[i].
Definition at line 46 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::kernel::array::axpby().
|
noexcept |
z[i] = a*x[i] + b*y[i].
Definition at line 59 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::kernel::array::axpbyz(), and num::backends::seq::matadd().
|
noexcept |
y[i] += alpha * x[i]
Definition at line 34 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::backends::seq::axpy().
|
noexcept |
dot product: return sum x[i] * y[i]
Definition at line 73 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::backends::seq::dot().
|
noexcept |
Rank-1 update: A[i*n + j] += alpha * x[i] * y[j] (m x n row-major)
Inner loop over j is independent and vectorizable.
Definition at line 160 of file raw.hpp.
References NUM_K_IVDEP, and NUM_K_RESTRICT.
Referenced by num::kernel::dense::ger().
|
noexcept |
L1 norm: sum |x[i]|.
Definition at line 103 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::kernel::reduce::l1_norm().
|
noexcept |
L-infinity norm: max |x[i]|.
Definition at line 114 of file raw.hpp.
Referenced by num::kernel::reduce::linf_norm().
|
noexcept |
y[i] = sum_j A[i*n + j] * x[j] (m x n row-major matrix)
y must be pre-allocated with size m. y and x must not alias A.
Definition at line 140 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::backends::seq::matvec().
|
noexcept |
Euclidean norm: sqrt(sum x[i]^2)
Definition at line 97 of file raw.hpp.
References norm_sq().
Referenced by num::backends::seq::norm().
|
noexcept |
sum x[i]^2 (no sqrt; use for convergence checks to avoid sqrt cost)
Definition at line 86 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by norm().
|
noexcept |
x[i] *= alpha
Definition at line 25 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::backends::seq::scale().
|
noexcept |
Scalar sum: return sum x[i].
Definition at line 127 of file raw.hpp.
References NUM_K_IVDEP.
Referenced by num::kernel::reduce::sum().
|
noexcept |
Forward substitution: solve Lx = b, L lower triangular (n x n, row-major).
x must be pre-allocated with size n. b and x must not alias each other.
Definition at line 181 of file raw.hpp.
Referenced by num::kernel::dense::trsv_lower().
|
noexcept |
Back substitution: solve Ux = b, U upper triangular (n x n, row-major).
x must be pre-allocated with size n. b and x must not alias each other.
Definition at line 200 of file raw.hpp.
Referenced by num::kernel::dense::trsv_upper().