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

Generator from a normal distribution. More...

#include <truncated_normal.hpp>

Public Types

using value_type = T
 The value type.
 

Public Member Functions

 truncated_normal_generator_op (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

random_engine rand_engine
 The random engine.
 
std::normal_distribution< value_typedistribution
 The used distribution.
 

Static Public Attributes

static constexpr bool gpu_computable = false
 Indicates if the operator is computable on GPU.
 

Friends

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

Detailed Description

template<typename T = double>
struct etl::truncated_normal_generator_op< T >

Generator from a normal distribution.

Constructor & Destructor Documentation

◆ truncated_normal_generator_op()

template<typename T = double>
etl::truncated_normal_generator_op< T >::truncated_normal_generator_op ( 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 T = double>
value_type etl::truncated_normal_generator_op< T >::operator() ( )
inline

Generate a new value.

Returns
the newly generated value

Friends And Related Function Documentation

◆ operator<<

template<typename T = double>
std::ostream& operator<< ( std::ostream &  os,
[[maybe_unused] ] const truncated_normal_generator_op< 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: