|
IPPL (Independent Parallel Particle Layer)
IPPL
|
A class for inverse transform sampling. More...
#include <InverseTransformSampling.h>
Classes | |
| struct | fill_random |
| Functor that is used for generating samples. More... | |
Public Types | |
| using | view_type = typename ippl::detail::ViewType<Vector<T, Dim>, 1>::view_type |
| using | size_type = ippl::detail::size_type |
Public Member Functions | |
| template<class RegionLayout> | |
| InverseTransformSampling (Distribution &dist_r, Vector< T, Dim > &rmax_r, Vector< T, Dim > &rmin_r, RegionLayout &rlayout_r, size_type &ntotal_r) | |
| Constructor for InverseTransformSampling class with domain decomposition. | |
| InverseTransformSampling (Distribution &dist_r, Vector< T, Dim > &rmax_r, Vector< T, Dim > &rmin_r, Vector< T, Dim > &locrmax_r, Vector< T, Dim > &locrmin_r, size_type &ntotal_r) | |
| Constructor for InverseTransformSampling class without applying domain decomposition.. | |
| InverseTransformSampling (Distribution &dist_r, Vector< T, Dim > &rmax_r, Vector< T, Dim > &rmin_r, size_type &ntotal_r) | |
| Constructor for InverseTransformSampling class. In this method, we do not consider any domain decomposition. | |
| void | updateBounds (Vector< T, Dim > &rmax, Vector< T, Dim > &rmin, Vector< T, Dim > &locrmax, Vector< T, Dim > &locrmin) |
| Updates the sampling bounds and reinitializes internal variables. | |
| void | updateBounds (Vector< T, Dim > &rmax, Vector< T, Dim > &rmin) |
| Updates the sampling bounds using the CDF without any domain decomposition. | |
| ~InverseTransformSampling () | |
| Deconstructor for InverseTransformSampling class. | |
| KOKKOS_INLINE_FUNCTION size_type | getLocalSamplesNum () const |
| Get the local number of samples. | |
| KOKKOS_INLINE_FUNCTION void | setLocalSamplesNum (size_type nlocal) |
| Set the local number of particles. | |
| void | generate (view_type view, Kokkos::Random_XorShift64_Pool<> rand_pool64) |
| Generate random samples using inverse transform sampling. | |
| void | generate (view_type view, size_type startIndex, size_type endIndex, Kokkos::Random_XorShift64_Pool<> rand_pool64) |
| Generate random samples using inverse transform sampling for a specific range of particles. | |
Public Attributes | |
| Distribution | dist_m |
| size_type | ntotal_m |
| Vector< T, Dim > | umin_m |
| Vector< T, Dim > | umax_m |
Private Attributes | |
| size_type | nlocal_m |
A class for inverse transform sampling.
This class performs inverse transform sampling for a given distribution.
| T | Data type. |
| Dim | Dimensionality of the sample space. |
| DeviceType | The device type for Kokkos. |
| Distribution | Type of the distribution to sample from. |
Definition at line 26 of file InverseTransformSampling.h.
| using ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::size_type = ippl::detail::size_type |
Definition at line 29 of file InverseTransformSampling.h.
| using ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::view_type = typename ippl::detail::ViewType<Vector<T, Dim>, 1>::view_type |
Definition at line 28 of file InverseTransformSampling.h.
|
inline |
Constructor for InverseTransformSampling class with domain decomposition.
| dist_r | The distribution to sample from. |
| rmax_r | Maximum global range. |
| rmin_r | Minimum global range. |
| rlayout_r | The region layout. |
| ntotal_r | Total number of samples to generate. |
Definition at line 45 of file InverseTransformSampling.h.
References ippl::Comm, Dim, dist_m, ntotal_m, and updateBounds().
|
inline |
Constructor for InverseTransformSampling class without applying domain decomposition..
| dist_r | The distribution to sample from. |
| rmax_r | Maximum global range. |
| rmin_r | Minimum global range. |
| locrmax_r | Maximum local (per rank) range. |
| locrmin_r | Minimum local (per rank) range. |
| ntotal_ | Total number of samples to generate. |
Definition at line 74 of file InverseTransformSampling.h.
References dist_m, ntotal_m, and updateBounds().
|
inline |
Constructor for InverseTransformSampling class. In this method, we do not consider any domain decomposition.
| dist_r | The distribution to sample from. |
| rmax_r | Maximum global range for sampling. |
| rmin_r | Minimum global range for sampling. |
| ntotal_r | Total number of samples to generate. |
Definition at line 91 of file InverseTransformSampling.h.
References dist_m, nlocal_m, ntotal_m, and updateBounds().
|
inline |
Deconstructor for InverseTransformSampling class.
Definition at line 166 of file InverseTransformSampling.h.
|
inline |
|
inline |
Generate random samples using inverse transform sampling for a specific range of particles.
| view | The view to fill with random samples. |
| startIndex | The starting index of view. |
| endIndex | The ending index of view. |
| rand_pool64 | The random number generator pool. |
Definition at line 267 of file InverseTransformSampling.h.
|
inline |
Get the local number of samples.
Definition at line 230 of file InverseTransformSampling.h.
References nlocal_m.
|
inline |
Set the local number of particles.
| nlocal | The new number of local particles. |
Definition at line 237 of file InverseTransformSampling.h.
References nlocal_m.
|
inline |
Updates the sampling bounds using the CDF without any domain decomposition.
This method allows the user to update the minimum and maximum bounds for the inverse transform sampling method. It recalculates the cumulative distribution function (CDF) values for the new bounds and updates the internal variables to reflect these changes.
| new_rmax | The new maximum range for sampling. This vector defines the upper bounds for each dimension. |
| new_rmin | The new minimum range for sampling. This vector defines the lower bounds for each dimension. |
Definition at line 155 of file InverseTransformSampling.h.
|
inline |
Updates the sampling bounds and reinitializes internal variables.
This method allows the user to update the minimum and maximum bounds for the sampling process It recalculates the cumulative distribution function (CDF) values for the new bounds and updates the internal variables to reflect these changes.
| rmax | The new maximum range for sampling. This vector defines the upper bounds for each dimension. |
| rmin | The new minimum range for sampling. This vector defines the lower bounds for each dimension. |
| locrmax | The new local maximum range for sampling. This vector defines the upper bounds for each dimension for a given rank. |
| locrmin | The new minimum range for sampling. This vector defines the lower bounds for each dimension for a given rank. |
Definition at line 117 of file InverseTransformSampling.h.
References ippl::Vector< T, Dim >::begin(), ippl::Comm, Dim, dist_m, ippl::Vector< T, Dim >::end(), nlocal_m, ntotal_m, umax_m, and umin_m.
Referenced by InverseTransformSampling(), InverseTransformSampling(), and InverseTransformSampling().
| Distribution ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::dist_m |
Definition at line 31 of file InverseTransformSampling.h.
Referenced by generate(), generate(), InverseTransformSampling(), InverseTransformSampling(), InverseTransformSampling(), updateBounds(), and updateBounds().
|
private |
Definition at line 282 of file InverseTransformSampling.h.
Referenced by generate(), getLocalSamplesNum(), InverseTransformSampling(), setLocalSamplesNum(), and updateBounds().
| size_type ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::ntotal_m |
Definition at line 32 of file InverseTransformSampling.h.
Referenced by InverseTransformSampling(), InverseTransformSampling(), InverseTransformSampling(), and updateBounds().
| Vector<T, Dim> ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::umax_m |
Definition at line 33 of file InverseTransformSampling.h.
Referenced by generate(), generate(), updateBounds(), and updateBounds().
| Vector<T, Dim> ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >::umin_m |
Definition at line 33 of file InverseTransformSampling.h.
Referenced by generate(), generate(), updateBounds(), and updateBounds().