C++ main module for mmsd Package  1.0
MATH_TranscendentEquation.h
Go to the documentation of this file.
1 #ifndef MATH_TranscendentEquation_H
2 #define MATH_TranscendentEquation_H
3 
4 
5 #include "CORE_Array.h"
6 
7 #include "MATH_Equation.h"
8 
9 
10 #include "MATH_Function.h"
11 
35 
37  SP_OBJECT(MATH_TranscendentEquation);
38 
39  // ATTRIBUTES
40 
41 public:
44  static const tFlag DEFAULT;
47  static const tFlag DELTA2;
50  static const tFlag DELTA2_2;
53  static const tFlag DELTA2_3;
56  static const tFlag STEFFENSEN;
57 private:
58  tFlag mMode;
59 
60  tReal mXInit;
61  int mIout;
62 
63 
64 private:
65 
66  // ASSOCIATIONS
67 
68 
69 protected:
70  // METHODS
71 
72  // CONSTRUCTORS
73 
76 
77 
78 
79  // DESTRUCTORS
80 
81 
84  virtual ~MATH_TranscendentEquation(void);
85 
86 
87 public:
88 
89  // NEW methods
90 
93  static SP::MATH_TranscendentEquation New() {
94  SP::MATH_TranscendentEquation p(new MATH_TranscendentEquation(),
96  p->setThis(p);
97  return p;
98  };
99 
100 
101  // COPY methods
102 
105  virtual void copy(const MATH_Equation* m);
106 
107  //-------------------------
108  // SAVER & LOADER methods
109  // ------------------------
110 
111 public:
114  virtual void loadFromUIClass(const UI_Class& mclass);
115 
118  virtual void saveToUIClass(UI_Class& mclass) const;
119 
120 
121  // SET methods
122 
123 public:
124 
125 
128  inline void setMode(const tFlag& v) {
129  mMode=v;
130  };
131 
134  inline void setInitValue(const tReal& v) {
135  mXInit=v;
136  };
137 
138 
141  inline void setIout(const int& i) {
142  mIout=i;
143  };
144 
145 
146  // GET methods
147 
148 public:
149 
150 
151 
154  inline tReal getInitValue() const {
155  return mXInit;
156  };
157 
158 
161  inline tFlag getMode() const {
162  return mMode;
163  };
164 
165 
166 
167  // OTHERS methdos
170  virtual tReal solve();
171  virtual tReal solve(const tReal& x0) {
172  mXInit=x0;
173  return solve();
174  }
175 
178  virtual tString toString() const;
179 
180 
181  //Internal methods
182 private:
183  tReal solve_default(tReal& error,int& iter);
184  tReal solve_d2(tReal& error,int& iter);
185  tReal solve_d2_2(tReal& error,int& iter);
186  tReal solve_d2_3(tReal& error,int& iter);
187  tReal solve_steffensen(tReal& error,int& iter);
188 };
189 
190 
191 #endif
void setInitValue(const tReal &v)
set init value
Definition: MATH_TranscendentEquation.h:134
virtual tReal solve(const tReal &x0)
solve the equation with initial point
Definition: MATH_TranscendentEquation.h:171
static const tFlag DELTA2_3
method flag for solving F(U_n)=U_n+1
Definition: MATH_TranscendentEquation.h:53
virtual tString toString() const
to string
Definition: MATH_TranscendentEquation.cpp:47
This class describes the main interface class for a soft user interface (R,matlab,python etc...) class.
Definition: UI_Class.h:38
virtual void saveToUIClass(UI_Class &mclass) const
how to save the object from a mate model class
Definition: MATH_TranscendentEquation.cpp:33
virtual ~MATH_TranscendentEquation(void)
destroy an TranscendentEquation Object.
Definition: MATH_TranscendentEquation.cpp:20
static const tFlag STEFFENSEN
method flag for solving F(U_n)=U_n+1
Definition: MATH_TranscendentEquation.h:56
tFlag getMode() const
get mode
Definition: MATH_TranscendentEquation.h:161
This class solve the equation f(x)=0.
Definition: MATH_Equation.h:21
virtual void loadFromUIClass(const UI_Class &mclass)
how to load the object from a Meta Model class
Definition: MATH_TranscendentEquation.cpp:39
static SP::MATH_TranscendentEquation New()
create a copy of MATH_TranscendentEquation
Definition: MATH_TranscendentEquation.h:93
tReal getInitValue() const
get the solution
Definition: MATH_TranscendentEquation.h:154
virtual void copy(const MATH_Equation *m)
copy the parameters of the optimization method
Definition: MATH_TranscendentEquation.cpp:23
static const tFlag DELTA2
method flag for solving F(U_n)=U_n+1
Definition: MATH_TranscendentEquation.h:47
DEFINE_SPTR(MATH_TranscendentEquation)
static const tFlag DEFAULT
method flag for solving F(U_n)=U_n+1
Definition: MATH_TranscendentEquation.h:44
virtual tReal solve()
solve
Definition: MATH_TranscendentEquation.cpp:51
void setMode(const tFlag &v)
set mode
Definition: MATH_TranscendentEquation.h:128
#define tString
Definition: types.h:49
DEFINE_SVPTR(MATH_TranscendentEquation)
void setIout(const int &i)
set output print
Definition: MATH_TranscendentEquation.h:141
This class solve a transcendent equation f(x)=x.
Definition: MATH_TranscendentEquation.h:36
MATH_TranscendentEquation(void)
create a TranscendentEquation object
Definition: MATH_TranscendentEquation.cpp:11
#define tReal
Definition: types.h:18
static const tFlag DELTA2_2
method flag for solving F(U_n)=U_n+1
Definition: MATH_TranscendentEquation.h:50
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:106
#define tFlag
Definition: types.h:14