alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
alpaka::rand::distribution::internal::BoxMuller< T_Fp > Struct Template Reference

Scalar Box-Muller transform for floating-point types. More...

#include <NormalReal.hpp>

Public Types

using result_type = T_Fp

Public Member Functions

template<concepts::UniformStdEngine T_Rng>
constexpr T_Fp operator() (T_Rng &rng)

Private Attributes

bool m_hasSecondRngNumber = false
T_Fp m_secondRngNumber

Detailed Description

template<std::floating_point T_Fp>
struct alpaka::rand::distribution::internal::BoxMuller< T_Fp >

Scalar Box-Muller transform for floating-point types.

Generates independent standard normal samples from a uniform scalar engine. The implementation caches the second sample so that a pair of uniforms yields two normal values.

Ref.: G. E. P. Box and M. E. Muller, "A Note on the Generation of Random Normal Deviates,"

Definition at line 26 of file NormalReal.hpp.

Member Typedef Documentation

◆ result_type

template<std::floating_point T_Fp>
using alpaka::rand::distribution::internal::BoxMuller< T_Fp >::result_type = T_Fp

Definition at line 28 of file NormalReal.hpp.

Member Function Documentation

◆ operator()()

template<std::floating_point T_Fp>
template<concepts::UniformStdEngine T_Rng>
T_Fp alpaka::rand::distribution::internal::BoxMuller< T_Fp >::operator() ( T_Rng & rng)
inlineconstexpr

Definition at line 31 of file NormalReal.hpp.

Member Data Documentation

◆ m_hasSecondRngNumber

template<std::floating_point T_Fp>
bool alpaka::rand::distribution::internal::BoxMuller< T_Fp >::m_hasSecondRngNumber = false
private

Definition at line 58 of file NormalReal.hpp.

◆ m_secondRngNumber

template<std::floating_point T_Fp>
T_Fp alpaka::rand::distribution::internal::BoxMuller< T_Fp >::m_secondRngNumber
private

Definition at line 57 of file NormalReal.hpp.


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