|
numerics 0.1.0
|
Functions | |
| void | axpby (real a, const Vector &x, real b, Vector &y, seq_t) noexcept |
| Sequential: y[i] = a*x[i] + b*y[i] (single-pass; calls raw::axpby) | |
| void | axpby (real a, const Vector &x, real b, Vector &y, par_t) |
| Parallel: y[i] = a*x[i] + b*y[i] (OMP parallel-for; falls back to seq_t when NUMERICS_HAS_OMP is not defined) | |
| void | axpby (real a, const Vector &x, real b, Vector &y) |
| Default policy (par_t if OMP available, seq_t otherwise) | |
| void | axpbyz (real a, const Vector &x, real b, const Vector &y, Vector &z, seq_t) noexcept |
| Sequential: z[i] = a*x[i] + b*y[i] (single-pass; calls raw::axpbyz) | |
| void | axpbyz (real a, const Vector &x, real b, const Vector &y, Vector &z, par_t) |
| Parallel: z[i] = a*x[i] + b*y[i] (OMP parallel-for) | |
| void | axpbyz (real a, const Vector &x, real b, const Vector &y, Vector &z) |
| Default policy. | |
| template<typename F > | |
| void | map (Vector &x, F &&f) |
| In-place elementwise map: x[i] = f(x[i]) | |
| template<typename F > | |
| void | map (CVector &x, F &&f) |
| In-place elementwise map on CVector. | |
| template<typename T , typename F > | |
| void | zip_map (const BasicVector< T > &x, const BasicVector< T > &y, BasicVector< T > &z, F &&f) |
| Fused binary map: z[i] = f(x[i], y[i]) | |
| template<typename F > | |
| real | reduce (const Vector &x, real init, F &&f) |
| Single-pass left fold: f(f(f(init, x[0]), x[1]), ..., x[n-1]) | |
Parallel: y[i] = a*x[i] + b*y[i] (OMP parallel-for; falls back to seq_t when NUMERICS_HAS_OMP is not defined)
Definition at line 24 of file array.cpp.
References axpby(), num::BasicVector< T >::data(), and num::BasicVector< T >::size().
Sequential: y[i] = a*x[i] + b*y[i] (single-pass; calls raw::axpby)
Definition at line 20 of file array.cpp.
References num::kernel::raw::axpby().
| void num::kernel::array::axpbyz | ( | real | a, |
| const Vector & | x, | ||
| real | b, | ||
| const Vector & | y, | ||
| Vector & | z, | ||
| par_t | |||
| ) |
Parallel: z[i] = a*x[i] + b*y[i] (OMP parallel-for)
Definition at line 47 of file array.cpp.
References axpbyz(), num::BasicVector< T >::data(), and num::BasicVector< T >::size().
|
noexcept |
Sequential: z[i] = a*x[i] + b*y[i] (single-pass; calls raw::axpbyz)
Definition at line 42 of file array.cpp.
References num::kernel::raw::axpbyz().
| void num::kernel::array::map | ( | CVector & | x, |
| F && | f | ||
| ) |
In-place elementwise map on CVector.
Definition at line 84 of file array.hpp.
References num::BasicVector< T >::data(), and num::BasicVector< T >::size().
| void num::kernel::array::map | ( | Vector & | x, |
| F && | f | ||
| ) |
In-place elementwise map: x[i] = f(x[i])
The compiler inlines f into the loop and can vectorize if f is a simple arithmetic expression. No policy needed.
Definition at line 74 of file array.hpp.
References num::BasicVector< T >::data(), and num::BasicVector< T >::size().
Single-pass left fold: f(f(f(init, x[0]), x[1]), ..., x[n-1])
Definition at line 117 of file array.hpp.
References num::BasicVector< T >::data(), reduce(), and num::BasicVector< T >::size().
Referenced by reduce().
| void num::kernel::array::zip_map | ( | const BasicVector< T > & | x, |
| const BasicVector< T > & | y, | ||
| BasicVector< T > & | z, | ||
| F && | f | ||
| ) |
Fused binary map: z[i] = f(x[i], y[i])
Single pass over memory; no temporary allocation. x, y, z must have the same size.
Definition at line 102 of file array.hpp.
References num::BasicVector< T >::size().