C++ mpi module for stochmagnet_main Package
SM_NoiseRateFunctionInterface.h
1 #ifndef SM_NoiseRateFunctionInterface_H
2 #define SM_NoiseRateFunctionInterface_H
3 
4 #include "SM_Object.h"
5 
14 
15  // ATTRIBUTES
16 
17 public:
18 
19 
20 
21 private:
22 
23 
24  tReal mNoiseRate;
25  tReal mNoisePower;
26 
27 protected:
28  // METHODS
29 
30  // CONSTRUCTORS
31 
35  mNoiseRate=0;
36  mNoisePower=1;
37  }
38 private:
44 
45  }
46 
47 
48 
49  // DESTRUCTORS
50 protected:
51 
55  }
56 
57 
58 
59 public:
60  //MEMORY
61 
75  virtual tMemSize getMemorySize() const {
76  return sizeof(*this)+getContentsMemorySize();
77  }
78 
79 
80 public:
81 
82 
83 
84  // SET methods
85 
86 
89  inline void adimensionize(const tReal& cField) {
90  mNoiseRate/=cField;
91  }
92 
96  inline void setNoiseRate(const tReal& eps) {
97  mNoiseRate=eps;
98  }
102  inline const tReal& getNoiseRate() const {
103  return mNoiseRate;
104  }
108  inline void setNoisePower(const tReal& eps) {
109  mNoisePower=eps;
110  }
114  inline const tReal& getNoisePower() const {
115  return mNoisePower;
116  }
117  // GET methods
118  // ============
119 
122  virtual tString getName() const=0;
123 
124 
125 
126 public:
127  // OTHERS methods
132  virtual tReal computeFunction(const tReal& t) const=0;
133 
134 
135 public:
140  inline void computeFunction(const tReal& t,tReal& epsilon) const {
141  epsilon=computeFunction(t);
142  }
143 
144 public:
145 
149  virtual tString toString() const final {
150  std::stringstream cstr;
151  cstr<<getName()<<" rate:"<<mNoiseRate<<" power="<<mNoisePower<<"\n";
152  return cstr.str();
153  }
154 
155 
156 
157 };
158 
159 #endif
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
This class describes a noise rate function.
Definition: SM_NoiseRateFunctionInterface.h:13
const tReal & getNoiseRate() const
get the noise rate
Definition: SM_NoiseRateFunctionInterface.h:102
void setNoisePower(const tReal &eps)
set the noise power
Definition: SM_NoiseRateFunctionInterface.h:108
SM_NoiseRateFunctionInterface(void)
create
Definition: SM_NoiseRateFunctionInterface.h:34
virtual tReal computeFunction(const tReal &t) const =0
compute the noise rate function
void computeFunction(const tReal &t, tReal &epsilon) const
compute the noise rate function
Definition: SM_NoiseRateFunctionInterface.h:140
const tReal & getNoisePower() const
get the noise power
Definition: SM_NoiseRateFunctionInterface.h:114
void setNoiseRate(const tReal &eps)
set the noise rate
Definition: SM_NoiseRateFunctionInterface.h:96
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_NoiseRateFunctionInterface.h:75
virtual tString toString() const final
return the string reprsentation or the class
Definition: SM_NoiseRateFunctionInterface.h:149
virtual tString getName() const =0
the the name of the system
virtual ~SM_NoiseRateFunctionInterface(void)
destroy
Definition: SM_NoiseRateFunctionInterface.h:54
void adimensionize(const tReal &cField)
adimensionize
Definition: SM_NoiseRateFunctionInterface.h:89
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:36