fpmas 1.6
Public Types | Public Member Functions | List of all members
fpmas::random::ConstantDistribution< T > Class Template Reference

#include <distribution.h>

Inheritance diagram for fpmas::random::ConstantDistribution< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::random::ConstantDistribution< T >:
Collaboration graph
[legend]

Public Types

typedef T result_type
 

Public Member Functions

 ConstantDistribution (const T &value)
 
template<typename Generator_t >
result_type operator() (Generator_t &)
 
result_type min () const override
 
result_type max () const override
 
virtual T min () const =0
 
virtual T max () const =0
 

Detailed Description

template<typename T>
class fpmas::random::ConstantDistribution< T >

A constant "random" distribution that always return the given value, with a probability P(value)=1.

This is notably useful for graph builders such as fpmas::graph::DistributedClusteredGraphBuilder, when the outgoing edges count of each node must be constant and not random.

Member Typedef Documentation

◆ result_type

template<typename T >
typedef T fpmas::random::ConstantDistribution< T >::result_type

Type of generated values.

Constructor & Destructor Documentation

◆ ConstantDistribution()

template<typename T >
fpmas::random::ConstantDistribution< T >::ConstantDistribution ( const T &  value)
inline

Generic ConstantDistribution constructor.

Parameters
valueconstant value of the distribution

Member Function Documentation

◆ operator()()

template<typename T >
template<typename Generator_t >
result_type fpmas::random::ConstantDistribution< T >::operator() ( Generator_t &  )
inline

Always returns the same value.

Template Parameters
Generator_tRandom number generator
Returns
constant value

◆ min()

template<typename T >
result_type fpmas::random::ConstantDistribution< T >::min ( ) const
inlineoverridevirtual

Returns the minimum value potentially generated by the distribution.

Returns
minimum generated value

Implements fpmas::api::random::Distribution< T >.

◆ max()

template<typename T >
result_type fpmas::random::ConstantDistribution< T >::max ( ) const
inlineoverridevirtual

Returns the maximum value potentially generated by the distribution.

Returns
maximum generated value

Implements fpmas::api::random::Distribution< T >.


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