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 >
23  {
24  public: // constructors
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 
52 
53 
54 #endif /*PROBA_DISTRIBUTIONS_H_*/
Uniform random distribution.
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
UniformRandomDistribution(T min, T max)
Set min and max bounds.
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
T operator()()
Draw a random number according to the current distribution.