00001 00025 #ifndef _SectionLineSearch_h 00026 #define _SectionLineSearch_h 00027 00028 00029 // SYSTEM INCLUDES 00030 // 00031 00032 // PROJECT INCLUDES 00033 // 00034 00035 // LOCAL INCLUDES 00036 // 00037 00038 #include "DoubleParameter.h" 00039 #include "LineSearch.h" 00040 #include "text-util.h" 00041 00042 // FORWARD REFERENCES 00043 // 00044 00045 00046 class SectionLineSearch 00047 : public LineSearch 00048 { 00049 public: 00050 // LIFECYCLE 00051 00052 friend class InitialSectionValidator; 00053 00056 ~SectionLineSearch(void); 00057 00058 00059 // OPERATORS 00060 00061 // OPERATIONS 00062 00063 virtual void UpdateStartingConditions(const Result* result) const; 00064 00065 virtual void ResetStartingConditions() const; 00066 00067 // ACCESS 00068 00069 void AddCommonParameterDescriptions 00070 (wxArrayString& descriptions, 00071 bool standalone) const; 00072 00073 virtual wxString ToString(bool standalone = true) const; 00074 00075 // INQUIRY 00076 00077 virtual bool CanAssist(const ProblemBase* pProblem) const; 00078 00079 protected: 00080 00083 SectionLineSearch(void); 00084 00089 SectionLineSearch(const SectionLineSearch& from); 00090 00091 00093 mutable DoubleParameter mA; 00095 mutable DoubleParameter mB; 00096 00097 DoubleParameter mInitialA; 00098 DoubleParameter mInitialB; 00099 00101 DoubleParameter mEpsilon; 00102 00103 DoubleParameter mSectionContractionOnUpdate; 00104 00105 // Ta metoda jest protected tylko ze względu na testy!!! 00127 void FindInitialSection(const UnivariateFunction& function, 00128 double& rA, 00129 double& rB, 00130 double initialSectionLength) const; 00131 private: 00132 00141 virtual std::auto_ptr<Result> Optimize(const ProblemBase& problem) const 00142 throw(OptimizationError); 00143 00151 virtual double Optimize(const UnivariateFunction& function) 00152 const; 00153 00169 virtual std::auto_ptr<Result> Solve( 00170 const UnivariateFunction& function, 00171 double a, 00172 double b, 00173 bool generateResult) 00174 const throw(OptimizationError) = 0; 00175 00176 }; 00177 00178 // INLINE METHODS 00179 // 00180 00181 // EXTERNAL REFERENCES 00182 // 00183 00184 #endif // _SectionLineSearch_h_