IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ippl::random::randu< T, Dim > Struct Template Reference

Functor to generate random numbers from a uniform distribution. More...

#include <Randu.h>

Collaboration diagram for ippl::random::randu< T, Dim >:

Public Types

using view_type
using GeneratorPool = typename Kokkos::Random_XorShift64_Pool<>

Public Member Functions

KOKKOS_INLINE_FUNCTION randu (view_type v_, GeneratorPool rand_pool_, T *rmin_p, T *rmax_p)
 Constructor for the randu functor.
KOKKOS_INLINE_FUNCTION randu (view_type v_, GeneratorPool rand_pool_)
KOKKOS_INLINE_FUNCTION void operator() (const size_t i) const
 Operator to generate random numbers.

Public Attributes

view_type v
GeneratorPool rand_pool
T rmin [Dim]
T rmax [Dim]

Detailed Description

template<typename T, unsigned Dim>
struct ippl::random::randu< T, Dim >

Functor to generate random numbers from a uniform distribution.

This functor generates random numbers from a uniform distribution in the range [rmin, rmax].

Template Parameters
TData type of the random numbers.
GeneratorPoolType of the random number generator pool.
DimDimensionality of the random numbers.

Definition at line 26 of file Randu.h.

Member Typedef Documentation

◆ GeneratorPool

template<typename T, unsigned Dim>
using ippl::random::randu< T, Dim >::GeneratorPool = typename Kokkos::Random_XorShift64_Pool<>

Definition at line 29 of file Randu.h.

◆ view_type

template<typename T, unsigned Dim>
using ippl::random::randu< T, Dim >::view_type
Initial value:

Definition at line 27 of file Randu.h.

Constructor & Destructor Documentation

◆ randu() [1/2]

template<typename T, unsigned Dim>
KOKKOS_INLINE_FUNCTION ippl::random::randu< T, Dim >::randu ( view_type v_,
GeneratorPool rand_pool_,
T * rmin_p,
T * rmax_p )
inline

Constructor for the randu functor.

Parameters
v_Output view for the random numbers.
rand_pool_The random number generator pool.
rminThe minimum of random number.
rmaxThe maximum of random number.

Definition at line 48 of file Randu.h.

References Dim, rand_pool, rmax, rmin, and v.

◆ randu() [2/2]

template<typename T, unsigned Dim>
KOKKOS_INLINE_FUNCTION ippl::random::randu< T, Dim >::randu ( view_type v_,
GeneratorPool rand_pool_ )
inline

Definition at line 58 of file Randu.h.

References Dim, rand_pool, rmax, rmin, and v.

Member Function Documentation

◆ operator()()

template<typename T, unsigned Dim>
KOKKOS_INLINE_FUNCTION void ippl::random::randu< T, Dim >::operator() ( const size_t i) const
inline

Operator to generate random numbers.

Parameters
iIndex for the random numbers.

Definition at line 72 of file Randu.h.

References Dim, rand_pool, rmax, rmin, and v.

Member Data Documentation

◆ rand_pool

template<typename T, unsigned Dim>
GeneratorPool ippl::random::randu< T, Dim >::rand_pool

Definition at line 35 of file Randu.h.

Referenced by operator()(), randu(), and randu().

◆ rmax

template<typename T, unsigned Dim>
T ippl::random::randu< T, Dim >::rmax[Dim]

Definition at line 38 of file Randu.h.

Referenced by operator()(), randu(), and randu().

◆ rmin

template<typename T, unsigned Dim>
T ippl::random::randu< T, Dim >::rmin[Dim]

Definition at line 37 of file Randu.h.

Referenced by operator()(), randu(), and randu().

◆ v

template<typename T, unsigned Dim>
view_type ippl::random::randu< T, Dim >::v

Definition at line 32 of file Randu.h.

Referenced by operator()(), randu(), and randu().


The documentation for this struct was generated from the following file: