aimstil
5.0.5
proba_distributions.h
Go to the documentation of this file.
1
#ifndef TIL_PROBA_DISTRIBUTIONS_H_
2
#define TIL_PROBA_DISTRIBUTIONS_H_
3
4
// includes from STL
5
6
// includes from TIL
7
#include "
til/miscTools.h
"
8
9
namespace
til
10
{
11
12
//---------------------------------------------------------------------------
13
14
// TODO: rajouter un namespace qqpart...
15
16
// TODO: Je pense qu'au final il faudra bien avoir son propre generateur de nombre aleatoire,
17
// parce qu'on veut pouvoir controler les seeds de maniere independante pour differentes instances
18
// de generateurs.
19
21
template
<
typename
T >
22
class
UniformRandomDistribution
23
{
24
public
:
// constructors
26
UniformRandomDistribution
(T
min
, T
max
);
27
public
:
// set & get
28
T &
min
() {
return
m_min; }
29
const
T &
min
()
const
{
return
m_min; }
30
T &
max
() {
return
m_max; }
31
const
T &
max
()
const
{
return
m_max; }
32
public
:
// functions
34
inline
T
operator()
();
35
private
:
// data
36
T m_min;
37
T m_max;
38
};
39
40
//---------------------------------------------------------------------------
41
43
// TODO: rename into uniform_rand
44
template
<
typename
T >
45
T
rand
(T
min
, T
max
);
46
47
//---------------------------------------------------------------------------
48
49
}
// namespace til
50
51
#include "
til/proba_distributions.tpp
"
52
53
54
#endif
/*PROBA_DISTRIBUTIONS_H_*/
til::UniformRandomDistribution::max
T & max()
Definition:
proba_distributions.h:30
til::UniformRandomDistribution
Uniform random distribution.
Definition:
proba_distributions.h:22
til
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition:
Accumulator.h:10
til::UniformRandomDistribution::UniformRandomDistribution
UniformRandomDistribution(T min, T max)
Set min and max bounds.
til::rand
void rand(TImage &im, typename TImage::value_type min, typename TImage::value_type max)
Fills the image with random numbers uniformly distributed on [min, max].
Definition:
imageTools.h:594
miscTools.h
til::UniformRandomDistribution::operator()
T operator()()
Draw a random number according to the current distribution.
til::UniformRandomDistribution::min
T & min()
Definition:
proba_distributions.h:28
proba_distributions.tpp
til::UniformRandomDistribution::max
const T & max() const
Definition:
proba_distributions.h:31
til::UniformRandomDistribution::min
const T & min() const
Definition:
proba_distributions.h:29
til
proba_distributions.h
Generated by
1.8.13