25 template <
typename T,
unsigned Dim>
50 for (
unsigned int i = 0; i <
Dim; i++) {
59 for (
unsigned int i = 0; i <
Dim; i++) {
70 KOKKOS_INLINE_FUNCTION
const T&
getMu(
unsigned int idx)
const {
return mu[idx]; }
77 KOKKOS_INLINE_FUNCTION
const T&
getSd(
unsigned int idx)
const {
return sd[idx]; }
84 KOKKOS_INLINE_FUNCTION
void operator()(
const size_t i)
const {
86 typename GeneratorPool::generator_type rand_gen =
rand_pool.get_state();
88 for (
unsigned d = 0; d <
Dim; ++d) {
89 v(i)[d] =
mu[d] +
sd[d] * rand_gen.normal(0.0, 1.0);
KOKKOS_INLINE_FUNCTION randn(view_type v_, GeneratorPool rand_pool_)
typename ippl::detail::ViewType< ippl::Vector< double, Dim >, 1 >::view_type view_type
KOKKOS_INLINE_FUNCTION randn(view_type v_, GeneratorPool rand_pool_, T *mu_p, T *sd_p)
Constructor for the randn functor.
KOKKOS_INLINE_FUNCTION const T & getSd(unsigned int idx) const
Getter function for the standard deviation in idx dimension.
typename Kokkos::Random_XorShift64_Pool<> GeneratorPool
KOKKOS_INLINE_FUNCTION const T & getMu(unsigned int idx) const
Getter function for mean in idx dimension.
KOKKOS_INLINE_FUNCTION void operator()(const size_t i) const
Operator to generate random numbers.