VTK-m
2.2
|
An ArrayHandle
that provides a source of random numbers with a standard normal distribution.
More...
#include <ArrayHandleRandomStandardNormal.h>
Public Types | |
using | SeedType = vtkm::Vec< vtkm::UInt32, 1 > |
using | UniformReal = vtkm::cont::ArrayHandleRandomUniformReal< Real > |
using | Thisclass = typename vtkm::cont::detail::GetTypeInParentheses< void(ArrayHandleRandomStandardNormal< Real >) >::type |
using | Superclass = typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandleTransform< vtkm::cont::ArrayHandleZip< vtkm::cont::ArrayHandleRandomUniformReal< Real >, vtkm::cont::ArrayHandleRandomUniformReal< Real > >, detail::BoxMuller >) >::type |
using | ValueType = typename Superclass::ValueType |
using | StorageTag = typename Superclass::StorageTag |
using | StorageType = typename Superclass::StorageType |
using | ReadPortalType = typename Superclass::ReadPortalType |
using | WritePortalType = typename Superclass::WritePortalType |
Public Member Functions | |
ArrayHandleRandomStandardNormal () | |
VTKM_CONT | ArrayHandleRandomStandardNormal (const Thisclass &src) |
VTKM_CONT | ArrayHandleRandomStandardNormal (Thisclass &&src) noexcept |
VTKM_CONT | ArrayHandleRandomStandardNormal (const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &src) |
VTKM_CONT | ArrayHandleRandomStandardNormal (vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&src) noexcept |
VTKM_CONT | ArrayHandleRandomStandardNormal (const std::vector< vtkm::cont::internal::Buffer > &buffers) |
VTKM_CONT | ArrayHandleRandomStandardNormal (std::vector< vtkm::cont::internal::Buffer > &&buffers) noexcept |
VTKM_CONT Thisclass & | operator= (const Thisclass &src) |
VTKM_CONT Thisclass & | operator= (Thisclass &&src) noexcept |
ArrayHandleRandomStandardNormal (vtkm::Id length, SeedType seed={ std::random_device{}() }) | |
Construct an ArrayHandleRandomStandardNormal . More... | |
An ArrayHandle
that provides a source of random numbers with a standard normal distribution.
ArrayHandleRandomStandardNormal
takes a user supplied seed and hashes it to provide a sequence of numbers drawn from a random standard normal distribution. The probability density function of the numbers is . The range of possible values is technically infinite, but the probability of large positive or negative numbers becomes vanishingly small.
This array uses the Box-Muller transform to pick random numbers in the stanard normal distribution.
Note: In contrast to traditional random number generator, ArrayHandleRandomStandardNormal
does not have "state", i.e. multiple calls the Get() method with the same index will always return the same hash value. To get a new set of random bits, create a new ArrayHandleRandomUniformBits
with a different seed.
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::ReadPortalType = typename Superclass::ReadPortalType |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::SeedType = vtkm::Vec<vtkm::UInt32, 1> |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::StorageTag = typename Superclass::StorageTag |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::StorageType = typename Superclass::StorageType |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::Superclass = typename vtkm::cont::detail::GetTypeInParentheses<void (vtkm::cont::ArrayHandleTransform< vtkm::cont::ArrayHandleZip<vtkm::cont::ArrayHandleRandomUniformReal<Real>, vtkm::cont::ArrayHandleRandomUniformReal<Real> >, detail::BoxMuller>) >::type |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::Thisclass = typename vtkm::cont::detail::GetTypeInParentheses<void (ArrayHandleRandomStandardNormal<Real>) >::type |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::UniformReal = vtkm::cont::ArrayHandleRandomUniformReal<Real> |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::ValueType = typename Superclass::ValueType |
using vtkm::cont::ArrayHandleRandomStandardNormal< Real >::WritePortalType = typename Superclass::WritePortalType |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlineexplicit |
|
inlineexplicitnoexcept |
|
inlineexplicit |
Construct an ArrayHandleRandomStandardNormal
.
length | Specifies the length of the generated array. |
seed | Provides a seed to use for the pseudorandom numbers. To prevent confusion between the seed and the length, the type of the seed is a vtkm::Vec of size 1. To specify the seed, declare it in braces. For example, to construct a random array of size 50 with seed 123, use ArrayHandleRandomStandardNormal(50, { 123 }) . |
|
inline |
|
inlinenoexcept |