Viskores
1.0
|
An ArrayHandle
that provides a source of random numbers with a standard normal distribution.
More...
#include <ArrayHandleRandomStandardNormal.h>
Public Types | |
using | SeedType = viskores::Vec< viskores::UInt32, 1 > |
using | UniformReal = viskores::cont::ArrayHandleRandomUniformReal< Real > |
using | Thisclass = typename viskores::cont::detail::GetTypeInParentheses< void(ArrayHandleRandomStandardNormal< Real >) >::type |
using | Superclass = typename viskores::cont::detail::GetTypeInParentheses< void(viskores::cont::ArrayHandleTransform< viskores::cont::ArrayHandleZip< viskores::cont::ArrayHandleRandomUniformReal< Real >, viskores::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 |
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 viskores::cont::ArrayHandleRandomStandardNormal< Real >::ReadPortalType = typename Superclass::ReadPortalType |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::SeedType = viskores::Vec<viskores::UInt32, 1> |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::StorageTag = typename Superclass::StorageTag |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::StorageType = typename Superclass::StorageType |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::Superclass = typename viskores::cont::detail::GetTypeInParentheses<void (viskores::cont::ArrayHandleTransform< viskores::cont::ArrayHandleZip<viskores::cont::ArrayHandleRandomUniformReal<Real>, viskores::cont::ArrayHandleRandomUniformReal<Real> >, detail::BoxMuller>) >::type |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::Thisclass = typename viskores::cont::detail::GetTypeInParentheses<void (ArrayHandleRandomStandardNormal<Real>) >::type |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::UniformReal = viskores::cont::ArrayHandleRandomUniformReal<Real> |
using viskores::cont::ArrayHandleRandomStandardNormal< Real >::ValueType = typename Superclass::ValueType |
using viskores::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 viskores::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 |