C++ mpi module for stochmagnet_main Package
RNDSTD_NormalDistribution.h
1 #ifndef RNDSTD_NormalDistribution_H
2 #define RNDSTD_NormalDistribution_H
3 
4 //inherited class header
5 #include "RAND_RandomNumberDistribution.h"
6 
7 //header for standart random laws
8 #include <random>
9 
16 class RNDSTD_NormalDistribution : public RAND_RandomNumberDistribution<tReal,std::normal_distribution<tReal>,RNDSTD_NormalDistribution> {
17  // ATTRIBUTES
18 
19 private:
20 
21  //type of the return value of the distribution
22  typedef tReal T;
23  //self class
25  //super class
27 
28 public:
29  // METHODS
30 
31  // CONSTRUCTORS
32 
35  std::normal_distribution<T> dist;
36  initialize(dist);
37  }
38 
39 
40 
41  // DESTRUCTORS
42 
43 
47  }
48 
49 
50 
51 public:
52 
53 
57  inline static CORE_UniquePointer<RNDSTD_NormalDistribution> New() {
58  return CORE_UniquePointer<RNDSTD_NormalDistribution>(new RNDSTD_NormalDistribution(),
60  }
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 
96 private:
97 
98 
99  // --------------------
100  // ATTRIBUTES setting
101  // --------------------
102 public:
103 
104 
105 
110  inline void setProperties(const T& mean,const T& sigma) {
111  std::normal_distribution<T>::param_type p(mean,sigma);
112  getDistribution().param(p);
113 
114  }
115 
116 
117 
118 
119 
120 
121 };
122 
123 #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(std::normal_distribution< tReal > &dist)
initiliaze generator
Definition: RAND_RandomNumberDistribution.h:103
std::normal_distribution< tReal > & getDistribution()
get distribution
Definition: RAND_RandomNumberDistribution.h:124
This class implements a stochastic function with a real uniform law implemented from the boost librar...
Definition: RNDSTD_NormalDistribution.h:16
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: RNDSTD_NormalDistribution.h:90
void setProperties(const T &mean, const T &sigma)
set the statistical properties of the distribution
Definition: RNDSTD_NormalDistribution.h:110
virtual ~RNDSTD_NormalDistribution(void)
destroy an object.
Definition: RNDSTD_NormalDistribution.h:46
RNDSTD_NormalDistribution()
create an object
Definition: RNDSTD_NormalDistribution.h:34
static CORE_UniquePointer< RNDSTD_NormalDistribution > New()
build a new instance of the stochasticfunction
Definition: RNDSTD_NormalDistribution.h:57
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: RNDSTD_NormalDistribution.h:78