00001
00132 #ifndef _QuadraticApproximation_h
00133 #define _QuadraticApproximation_h
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143 #include "../DoubleParameter.h"
00144 #include "../ProblemBase.h"
00145 #include "../SectionLineSearch.h"
00146 #include "../UnivariateFunction.h"
00147 #include "../ui/SectionLineSearchPanel.h"
00148
00149
00150
00151
00152 class QuadraticApproximation
00153 : public SectionLineSearch
00154 {
00155 public:
00156 friend class SectionLineSearchPanel<QuadraticApproximation>;
00157
00158
00159
00162 ~QuadraticApproximation(void);
00163
00164
00165
00166
00167
00170 virtual std::auto_ptr<Method> Clone() const;
00171
00172
00175 virtual const wxString& Name() const;
00176
00179 virtual MethodIdType Id() const;
00180
00183 static MethodIdType ClassId();
00184
00185
00186
00187 virtual bool CanHandle(const ProblemBase* pProblem) const;
00188
00189 protected:
00190
00193 QuadraticApproximation(void);
00194
00199 QuadraticApproximation(const QuadraticApproximation& from);
00200
00201 virtual wxString& rName();
00202 private:
00203
00204 virtual std::auto_ptr<Result> Solve(
00205 const UnivariateFunction& function,
00206 double a,
00207 double b,
00208 bool generateResult)
00209 const throw(OptimizationError);
00210
00237 double FindApproximationMinimizer(double a,
00238 double m,
00239 double b,
00240 double valueA,
00241 double valueM,
00242 double valueB,
00243 bool& success) const;
00244
00245 static wxString mName;
00246 static QuadraticApproximation mQuadraticApproximation;
00247 };
00248
00249
00250
00251
00252
00253
00254
00255 #endif // _QuadraticApproximation_h_