version 3.10-dev
Dumux::SimpleUniformDistribution< Scalar > Class Template Reference

A simple uniform distribution based on a biased uniform number generator. More...

#include <dumux/common/random.hh>

Description

template<class Scalar = double>
class Dumux::SimpleUniformDistribution< Scalar >
Note
Use this if you need a fast library implementation independent generator without strict requirements about the bias
We try to stay close to https://en.cppreference.com/w/cpp/numeric/random/uniform_real_distribution

Public Types

using param_type = Parameters
 
using result_type = Scalar
 

Public Member Functions

 SimpleUniformDistribution (Scalar min, Scalar max=1.0)
 
 SimpleUniformDistribution (const Parameters &p)
 
 SimpleUniformDistribution ()
 
void param (const Parameters &p)
 
Parameters param () const
 
Scalar a () const
 
Scalar b () const
 
template<class Generator , typename std::enable_if_t< std::is_same_v< typename Generator::result_type, std::uint_fast32_t >, int > = 0>
Scalar operator() (Generator &gen)
 

Member Typedef Documentation

◆ param_type

template<class Scalar = double>
using Dumux::SimpleUniformDistribution< Scalar >::param_type = Parameters

◆ result_type

template<class Scalar = double>
using Dumux::SimpleUniformDistribution< Scalar >::result_type = Scalar

Constructor & Destructor Documentation

◆ SimpleUniformDistribution() [1/3]

template<class Scalar = double>
Dumux::SimpleUniformDistribution< Scalar >::SimpleUniformDistribution ( Scalar  min,
Scalar  max = 1.0 
)
inlineexplicit

◆ SimpleUniformDistribution() [2/3]

template<class Scalar = double>
Dumux::SimpleUniformDistribution< Scalar >::SimpleUniformDistribution ( const Parameters &  p)
inlineexplicit

◆ SimpleUniformDistribution() [3/3]

template<class Scalar = double>
Dumux::SimpleUniformDistribution< Scalar >::SimpleUniformDistribution ( )
inline

Member Function Documentation

◆ a()

template<class Scalar = double>
Scalar Dumux::SimpleUniformDistribution< Scalar >::a ( ) const
inline

◆ b()

template<class Scalar = double>
Scalar Dumux::SimpleUniformDistribution< Scalar >::b ( ) const
inline

◆ operator()()

template<class Scalar = double>
template<class Generator , typename std::enable_if_t< std::is_same_v< typename Generator::result_type, std::uint_fast32_t >, int > = 0>
Scalar Dumux::SimpleUniformDistribution< Scalar >::operator() ( Generator &  gen)
inline

◆ param() [1/2]

template<class Scalar = double>
Parameters Dumux::SimpleUniformDistribution< Scalar >::param ( ) const
inline

◆ param() [2/2]

template<class Scalar = double>
void Dumux::SimpleUniformDistribution< Scalar >::param ( const Parameters &  p)
inline

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