VTK-m
2.2
|
An ArrayHandle
that provides a source of random numbers with uniform distribution.
More...
#include <ArrayHandleRandomUniformReal.h>
Public Types | |
using | SeedType = vtkm::Vec< vtkm::UInt32, 1 > |
using | Thisclass = typename vtkm::cont::detail::GetTypeInParentheses< void(ArrayHandleRandomUniformReal< Real >) >::type |
using | Superclass = typename vtkm::cont::detail::GetTypeInParentheses< void(vtkm::cont::ArrayHandleTransform< vtkm::cont::ArrayHandleRandomUniformBits, detail::CanonicalFunctor< Real > >) >::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 | |
ArrayHandleRandomUniformReal () | |
VTKM_CONT | ArrayHandleRandomUniformReal (const Thisclass &src) |
VTKM_CONT | ArrayHandleRandomUniformReal (Thisclass &&src) noexcept |
VTKM_CONT | ArrayHandleRandomUniformReal (const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &src) |
VTKM_CONT | ArrayHandleRandomUniformReal (vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&src) noexcept |
VTKM_CONT | ArrayHandleRandomUniformReal (const std::vector< vtkm::cont::internal::Buffer > &buffers) |
VTKM_CONT | ArrayHandleRandomUniformReal (std::vector< vtkm::cont::internal::Buffer > &&buffers) noexcept |
VTKM_CONT Thisclass & | operator= (const Thisclass &src) |
VTKM_CONT Thisclass & | operator= (Thisclass &&src) noexcept |
ArrayHandleRandomUniformReal (vtkm::Id length, SeedType seed={ std::random_device{}() }) | |
Construct an ArrayHandleRandomUniformReal . More... | |
An ArrayHandle
that provides a source of random numbers with uniform distribution.
ArrayHandleRandomUniformReal
takes a user supplied seed and hashes it to provide a sequence of numbers drawn from a random uniform distribution in the range [0, 1). ArrayHandleRandomUniformReal
is built on top of ArrayHandleRandomUniformBits
so shares its behavior with that array.
Note: In contrast to traditional random number generator, ArrayHandleRandomUniformReal
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::ArrayHandleRandomUniformReal< Real >::ReadPortalType = typename Superclass::ReadPortalType |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::SeedType = vtkm::Vec<vtkm::UInt32, 1> |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::StorageTag = typename Superclass::StorageTag |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::StorageType = typename Superclass::StorageType |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::Superclass = typename vtkm::cont::detail::GetTypeInParentheses<void (vtkm::cont::ArrayHandleTransform<vtkm::cont::ArrayHandleRandomUniformBits, detail::CanonicalFunctor<Real> >) >::type |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::Thisclass = typename vtkm::cont::detail::GetTypeInParentheses<void (ArrayHandleRandomUniformReal<Real>) >::type |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::ValueType = typename Superclass::ValueType |
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::WritePortalType = typename Superclass::WritePortalType |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlineexplicit |
|
inlineexplicitnoexcept |
|
inlineexplicit |
Construct an ArrayHandleRandomUniformReal
.
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 ArrayHandleRandomUniformReal(50, { 123 }) . |
|
inline |
|
inlinenoexcept |