VTK-m  2.2
Public Types | Public Member Functions | List of all members
vtkm::cont::ArrayHandleRandomUniformReal< Real > Class Template Reference

An ArrayHandle that provides a source of random numbers with uniform distribution. More...

#include <ArrayHandleRandomUniformReal.h>

Inheritance diagram for vtkm::cont::ArrayHandleRandomUniformReal< Real >:
vtkm::cont::ArrayHandleTransform< vtkm::cont::ArrayHandleRandomUniformBits, detail::CanonicalFunctor< vtkm::Float64 > >

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 Thisclassoperator= (const Thisclass &src)
 
VTKM_CONT Thisclassoperator= (Thisclass &&src) noexcept
 
 ArrayHandleRandomUniformReal (vtkm::Id length, SeedType seed={ std::random_device{}() })
 Construct an ArrayHandleRandomUniformReal. More...
 

Detailed Description

template<typename Real = vtkm::Float64>
class vtkm::cont::ArrayHandleRandomUniformReal< Real >

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.

Member Typedef Documentation

◆ ReadPortalType

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::ReadPortalType = typename Superclass::ReadPortalType

◆ SeedType

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::SeedType = vtkm::Vec<vtkm::UInt32, 1>

◆ StorageTag

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::StorageTag = typename Superclass::StorageTag

◆ StorageType

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::StorageType = typename Superclass::StorageType

◆ Superclass

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::Superclass = typename vtkm::cont::detail::GetTypeInParentheses<void (vtkm::cont::ArrayHandleTransform<vtkm::cont::ArrayHandleRandomUniformBits, detail::CanonicalFunctor<Real> >) >::type

◆ Thisclass

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::Thisclass = typename vtkm::cont::detail::GetTypeInParentheses<void (ArrayHandleRandomUniformReal<Real>) >::type

◆ ValueType

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::ValueType = typename Superclass::ValueType

◆ WritePortalType

template<typename Real = vtkm::Float64>
using vtkm::cont::ArrayHandleRandomUniformReal< Real >::WritePortalType = typename Superclass::WritePortalType

Constructor & Destructor Documentation

◆ ArrayHandleRandomUniformReal() [1/8]

template<typename Real = vtkm::Float64>
vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( )
inline

◆ ArrayHandleRandomUniformReal() [2/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( const Thisclass src)
inline

◆ ArrayHandleRandomUniformReal() [3/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( Thisclass &&  src)
inlinenoexcept

◆ ArrayHandleRandomUniformReal() [4/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( const vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &  src)
inline

◆ ArrayHandleRandomUniformReal() [5/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( vtkm::cont::ArrayHandle< typename Superclass::ValueType, typename Superclass::StorageTag > &&  src)
inlinenoexcept

◆ ArrayHandleRandomUniformReal() [6/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( const std::vector< vtkm::cont::internal::Buffer > &  buffers)
inlineexplicit

◆ ArrayHandleRandomUniformReal() [7/8]

template<typename Real = vtkm::Float64>
VTKM_CONT vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( std::vector< vtkm::cont::internal::Buffer > &&  buffers)
inlineexplicitnoexcept

◆ ArrayHandleRandomUniformReal() [8/8]

template<typename Real = vtkm::Float64>
vtkm::cont::ArrayHandleRandomUniformReal< Real >::ArrayHandleRandomUniformReal ( vtkm::Id  length,
SeedType  seed = { std::random_device{}() } 
)
inlineexplicit

Construct an ArrayHandleRandomUniformReal.

Parameters
lengthSpecifies the length of the generated array.
seedProvides 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 }).

Member Function Documentation

◆ operator=() [1/2]

template<typename Real = vtkm::Float64>
VTKM_CONT Thisclass& vtkm::cont::ArrayHandleRandomUniformReal< Real >::operator= ( const Thisclass src)
inline

◆ operator=() [2/2]

template<typename Real = vtkm::Float64>
VTKM_CONT Thisclass& vtkm::cont::ArrayHandleRandomUniformReal< Real >::operator= ( Thisclass &&  src)
inlinenoexcept

The documentation for this class was generated from the following file: