C++ mpi module for stochmagnet_main Package
RNDB_NormalDistribution.h
1 #ifndef RNDB_NormalDistribution_H
2 #define RNDB_NormalDistribution_H
3 
4 //inherited class haeder
5 #include "RAND_RandomNumberDistribution.h"
6 
7 //boost header
8 #include <boost/random/normal_distribution.hpp>
9 
15 class RNDB_NormalDistribution : public RAND_RandomNumberDistribution<tReal,boost::random::normal_distribution<tReal>,RNDB_NormalDistribution> {
16  // ATTRIBUTES
17 
18 private:
19 
20  //type of the return value of the distribution
21  typedef tReal T;
22  //self class
24  //super class
26 
27 public:
28  // METHODS
29 
30  // CONSTRUCTORS
31 
34  boost::random::normal_distribution<T> dist;
35  initialize(dist);
36  }
37 
38 
39 
40 // DESTRUCTORS
41 
42 
45  virtual ~RNDB_NormalDistribution(void) {
46  }
47 
48 
49 
50 public:
51 
55  inline static CORE_UniquePointer<RNDB_NormalDistribution> New() {
56  return CORE_UniquePointer<RNDB_NormalDistribution>(new RNDB_NormalDistribution(),
58  }
59 
60 private:
61 
62 public:
63 
64  //MEMORY
78  virtual tMemSize getMemorySize() const {
79  return sizeof(*this)+getContentsMemorySize();
80  }
81 
90  virtual tMemSize getContentsMemorySize() const {
91  tMemSize mem= SuperSelf::getContentsMemorySize();
92  return mem;
93  }
94 
95 
100  inline void setProperties(const T& mean,const T& sigma) {
101  boost::random::normal_distribution<T>::param_type p(mean,sigma);
102  getDistribution().param(p);
103 
104  }
105 
106 
107 };
108 
109 #endif
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:113
This class generates a distribution implemented in class G with internal implementation class I with ...
Definition: RAND_RandomNumberDistribution.h:17
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: RAND_RandomNumberDistribution.h:88
void initialize(boost::random::normal_distribution< tReal > &dist)
initiliaze generator
Definition: RAND_RandomNumberDistribution.h:103
boost::random::normal_distribution< tReal > & getDistribution()
get distribution
Definition: RAND_RandomNumberDistribution.h:124
This class implements a normal law distribution.
Definition: RNDB_NormalDistribution.h:15
virtual ~RNDB_NormalDistribution(void)
destroy an object.
Definition: RNDB_NormalDistribution.h:45
void setProperties(const T &mean, const T &sigma)
set the statistical properties of the distribution
Definition: RNDB_NormalDistribution.h:100
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: RNDB_NormalDistribution.h:78
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: RNDB_NormalDistribution.h:90
RNDB_NormalDistribution()
create an object
Definition: RNDB_NormalDistribution.h:33
static CORE_UniquePointer< RNDB_NormalDistribution > New()
build a new instance of the stochasticfunction
Definition: RNDB_NormalDistribution.h:55