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

Generator from an uniform distribution using a custom random engine. More...

#include <uniform.hpp>

Public Types

using value_type = T
 The value type.
 

Public Member Functions

 uniform_generator_g_op (G &g, T start, T end)
 Construct a new generator with the given start and end of the range. More...
 
value_type operator() ()
 Generate a new value. More...
 

Public Attributes

const T start
 The start of the distribution.
 
const T end
 The end of the distribution.
 
G & rand_engine
 The random engine.
 
uniform_distribution< value_typedistribution
 The used distribution.
 

Static Public Attributes

static constexpr bool gpu_computable
 Indicates if the operator can be computed on GPU. More...
 

Friends

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

Detailed Description

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

Generator from an uniform distribution using a custom random engine.

Constructor & Destructor Documentation

◆ uniform_generator_g_op()

template<typename G , typename T = double>
etl::uniform_generator_g_op< G, T >::uniform_generator_g_op ( G &  g,
start,
end 
)
inline

Construct a new generator with the given start and end of the range.

Parameters
startThe beginning of the range
endThe end of the range

Member Function Documentation

◆ operator()()

template<typename G , typename T = double>
value_type etl::uniform_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 uniform_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

Member Data Documentation

◆ gpu_computable

template<typename G , typename T = double>
constexpr bool etl::uniform_generator_g_op< G, T >::gpu_computable
static
Initial value:
&& ((is_single_precision_t<T> && impl::egblas::has_scalar_sadd && impl::egblas::has_scalar_smul)
|| (is_double_precision_t<T> && impl::egblas::has_scalar_dadd && impl::egblas::has_scalar_dmul))

Indicates if the operator can be computed on GPU.


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