Class TempLat::RandomGaussianFieldHelper
template <typename T, size_t NDim, SpaceStateType Space, bool Real, bool Unitary>
ClassList > TempLat > RandomGaussianFieldHelper
A class which initializes a complex random gaussian field. ONLY WORKS FOR FFTW R2C complex layouts. It has a state, which counts the number of times it has been used. As in the backend a deterministic, stateless RNG is used, we need to keep track of this in order to generate a new set of random numbers each time. More...
#include <randomgaussianfield.h>
Inherits the following classes: TempLat::DimensionCountRecorder
Public Functions
| Type | Name |
|---|---|
| RandomGaussianFieldHelper (std::string baseSeed, device::memory::host_ptr< MemoryToolBox< NDim > > pToolBox) |
|
| DEVICE_INLINE_FUNCTION auto | eval (const IDX &... idx) const |
| auto | getCurrentSeed () const |
| DEVICE_INLINE_FUNCTION std::tuple< RNGInteger, RNGInteger > | gidx_to_idx2 (const device::IdxArray< NDim > & gidx) const |
| void | loadState (const std::string & state) Restores Gaussian RNG state from a serialized string. |
| void | postGet () |
| void | preGet () |
| void | reset () |
| std::string | saveState () const Serializes the complete Gaussian RNG state to a string. |
| std::string | toString () const |
| DEVICE_INLINE_FUNCTION complex< T > | to_complex (const device::array< R, 2 > & pair) const |
Public Functions inherited from TempLat::DimensionCountRecorder
See TempLat::DimensionCountRecorder
| Type | Name |
|---|---|
| DimensionCountRecorder (SpaceStateType spaceType) |
|
| void | confirmSpace (const LayoutStruct< NDim > & newLayout, const SpaceStateType & spaceType) const When making sure everyone is in configuration or fourier space, steal the number of dimensions, which we need in the coordinate manipulating objects.. |
| DEVICE_FORCEINLINE_FUNCTION const LayoutStruct< NDim > & | getCurrentLayout () const |
| SpaceStateType | getCurrentSpaceType () const |
| std::string | toString () const |
Public Static Functions inherited from TempLat::DimensionCountRecorder
See TempLat::DimensionCountRecorder
| Type | Name |
|---|---|
| constexpr device::Idx | getNDimensions () |
Detailed Description
Unit test: ctest -R test-randomgaussianfield
Public Functions Documentation
function RandomGaussianFieldHelper
inline TempLat::RandomGaussianFieldHelper::RandomGaussianFieldHelper (
std::string baseSeed,
device::memory::host_ptr < MemoryToolBox < NDim > > pToolBox
)
function eval
template<typename... IDX>
inline DEVICE_INLINE_FUNCTION auto TempLat::RandomGaussianFieldHelper::eval (
const IDX &... idx
) const
function getCurrentSeed
function gidx_to_idx2
inline DEVICE_INLINE_FUNCTION std::tuple< RNGInteger, RNGInteger > TempLat::RandomGaussianFieldHelper::gidx_to_idx2 (
const device::IdxArray< NDim > & gidx
) const
function loadState
Restores Gaussian RNG state from a serialized string.
Parameters:
stateString produced by saveState()
function postGet
function preGet
function reset
function saveState
Serializes the complete Gaussian RNG state to a string.
Returns:
String containing underlying uniform RNG state, counter, and Box-Muller cache
function toString
function to_complex
template<typename R>
inline DEVICE_INLINE_FUNCTION complex< T > TempLat::RandomGaussianFieldHelper::to_complex (
const device::array< R, 2 > & pair
) const
The documentation for this class was generated from the following file cosmolatticeweb/tmp/code_source/templat/include/TempLat/lattice/algebra/random/randomgaussianfield.h