C++ main module for stochmagnet Package  1.0
SM_NoiseRateFunction.h
Go to the documentation of this file.
1 #ifndef SM_NoiseRateFunction_H
2 #define SM_NoiseRateFunction_H
3 
4 #include "SM_Object.h"
5 
14 
15  // ATTRIBUTES
16 
17 public:
18 
19 
20 
21 private:
22 
23 
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 
54  virtual ~SM_NoiseRateFunction(void) {
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 
90  inline void setNoiseRate(const tReal& eps) {
91  mNoiseRate=eps;
92  }
96  inline const tReal& getNoiseRate() const {
97  return mNoiseRate;
98  }
102  inline void setNoisePower(const tReal& eps) {
103  mNoisePower=eps;
104  }
108  inline const tReal& getNoisePower() const {
109  return mNoisePower;
110  }
111  // GET methods
112  // ============
113 
116  virtual tString getName() const=0;
117 
118 
119 
120 public:
121  // OTHERS methods
126  virtual tReal computeFunction(const tReal& t) const=0;
127 
131  virtual tString toString() const final {
132  std::stringstream cstr;
133  cstr<<getName()<<" rate:"<<mNoiseRate<<" power="<<mNoisePower<<"\n";
134  return cstr.str();
135  }
136 
137 
138 
139 };
140 
141 #endif
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:259
This class describes a noise rate function.
Definition: SM_NoiseRateFunction.h:13
SM_NoiseRateFunction(const SM_NoiseRateFunction &f)
create a copy of instance of function f
Definition: SM_NoiseRateFunction.h:43
virtual ~SM_NoiseRateFunction(void)
destroy
Definition: SM_NoiseRateFunction.h:54
virtual tReal computeFunction(const tReal &t) const =0
compute the noise rate function
void setNoiseRate(const tReal &eps)
set the noise rate
Definition: SM_NoiseRateFunction.h:90
void setNoisePower(const tReal &eps)
set the noise power
Definition: SM_NoiseRateFunction.h:102
virtual tString toString() const final
return the string reprsentation or the class
Definition: SM_NoiseRateFunction.h:131
const tReal & getNoiseRate() const
get the noise rate
Definition: SM_NoiseRateFunction.h:96
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_NoiseRateFunction.h:75
const tReal & getNoisePower() const
get the noise power
Definition: SM_NoiseRateFunction.h:108
virtual tString getName() const =0
the the name of the system
tReal mNoiseRate
Definition: SM_NoiseRateFunction.h:24
SM_NoiseRateFunction(void)
create
Definition: SM_NoiseRateFunction.h:34
tReal mNoisePower
Definition: SM_NoiseRateFunction.h:25
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:19
#define tString
Definition: types.h:147
#define tMemSize
Definition: types.h:166
#define tReal
Definition: types.h:137