|
IPPL API Reference
Independent Parallel Particle Layer C++ API
|
A class for inverse transform sampling. More...
#include <InverseTransformSampling.h>
Collaboration diagram for ippl::random::InverseTransformSampling< T, Dim, DeviceType, Distribution >: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 |
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. |
|
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. |
|
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. |
|
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. |
|
inline |
Generate random samples using inverse transform sampling.
| view | The view to fill with random samples. |
| rand_pool64 | The random number generator pool. |
|
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. |
|
inline |
Get the local number of samples.
|
inline |
Set the local number of particles.
| nlocal | The new number of local particles. |
|
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. |
|
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. |