Expression Templates Library (ETL)
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Friends | List of all members
etl::normal_generator_g_op< G, T > Struct Template Reference

Generator from a normal distribution using a custom random engine. More...

#include <normal.hpp>

Public Types

using value_type = T
 The value type.
 

Public Member Functions

 normal_generator_g_op (G &g, T mean, T stddev)
 Construct a new generator with the given mean and standard deviation. More...
 
value_type operator() ()
 Generate a new value. More...
 

Public Attributes

const T mean
 The mean.
 
const T stddev
 The standard deviation.
 
G & rand_engine
 The random engine.
 
std::normal_distribution< value_typedistribution
 The used distribution.
 

Static Public Attributes

static constexpr bool gpu_computable = (is_single_precision_t<T> && curand_enabled) || (is_double_precision_t<T> && curand_enabled)
 Indicates if the operator can be computed on GPU.
 

Friends

std::ostream & operator<< (std::ostream &os, [[maybe_unused]] const normal_generator_g_op &s)
 Outputs the given generator to the given stream. More...
 

Detailed Description

template<typename G, typename T = double>
struct etl::normal_generator_g_op< G, T >

Generator from a normal distribution using a custom random engine.

Constructor & Destructor Documentation

◆ normal_generator_g_op()

template<typename G , typename T = double>
etl::normal_generator_g_op< G, T >::normal_generator_g_op ( G &  g,
mean,
stddev 
)
inline

Construct a new generator with the given mean and standard deviation.

Parameters
meanThe mean
stddevThe standard deviation

Member Function Documentation

◆ operator()()

template<typename G , typename T = double>
value_type etl::normal_generator_g_op< G, T >::operator() ( )
inline

Generate a new value.

Returns
the newly generated value

Friends And Related Function Documentation

◆ operator<<

template<typename G , typename T = double>
std::ostream& operator<< ( std::ostream &  os,
[[maybe_unused] ] const normal_generator_g_op< G, T > &  s 
)
friend

Outputs the given generator to the given stream.

Parameters
osThe output stream
sThe generator
Returns
the output stream

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