39 const uint max_block_size = 0)
59 template <
typename... T> NT
get(
const ctype k,
const T &...t)
const
64 const auto constant = KERNEL::constant(k, t...);
65 return constant + tbb::parallel_reduce(
67 [&](
const tbb::blocked_range2d<uint, uint> &r, NT value) -> NT {
68 for (
uint idx_x = r.rows().begin(); idx_x != r.rows().end(); ++idx_x) {
70 for (
uint idx_y = r.cols().begin(); idx_y != r.cols().end(); ++idx_y) {
72 const ctype int_element =
78 value += int_element * weight * KERNEL::kernel(q, cos, k, t...);
83 [&](NT x, NT y) -> NT {
return x + y; });
96 template <
typename... T> std::future<NT>
request(
const ctype k,
const T &...t)
const
98 return std::async(std::launch::deferred, [=,
this]() {
return get(k, t...); });
Integrator for the integration of a function with one angle with TBB. Calculates.
Definition integrator_angle_cpu.hh:25
const std::array< uint, 2 > grid_sizes
Definition integrator_angle_cpu.hh:102
NT get(const ctype k, const T &...t) const
Get the integral of the kernel.
Definition integrator_angle_cpu.hh:59
const std::vector< ctype > & x_quadrature_p
Definition integrator_angle_cpu.hh:106
IntegratorAngleTBB(QuadratureProvider &quadrature_provider, const std::array< uint, 2 > grid_sizes, const ctype x_extent, const JSONValue &)
Definition integrator_angle_cpu.hh:32
std::future< NT > request(const ctype k, const T &...t) const
Request a future for the integral of the kernel.
Definition integrator_angle_cpu.hh:96
const std::vector< ctype > & ang_quadrature_p
Definition integrator_angle_cpu.hh:108
const std::vector< ctype > & ang_quadrature_w
Definition integrator_angle_cpu.hh:109
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_angle_cpu.hh:30
const ctype x_extent
Definition integrator_angle_cpu.hh:104
const std::vector< ctype > & x_quadrature_w
Definition integrator_angle_cpu.hh:107
IntegratorAngleTBB(QuadratureProvider &quadrature_provider, std::array< uint, 2 > grid_sizes, const ctype x_extent, const uint max_block_size=0)
Definition integrator_angle_cpu.hh:38
A wrapper around the boost json value class.
Definition json.hh:19
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:139
typename internal::_ctype< CT >::value ctype
Definition types.hh:106
Definition complex_math.hh:14
constexpr __forceinline__ __host__ __device__ NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:45
constexpr __forceinline__ __host__ __device__ double S_d(NT d)
Surface of a d-dimensional sphere.
Definition math.hh:91
consteval NT S_d_prec(uint d)
Surface of a d-dimensional sphere (precompiled)
Definition math.hh:104
unsigned int uint
Definition utils.hh:22