00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef ROOT_Math_IRootFinderMethod
00017 #define ROOT_Math_IRootFinderMethod
00018
00019 #ifndef ROOT_Math_Error
00020 #include "Math/Error.h"
00021 #endif
00022
00023 #ifndef ROOT_Math_IFunctionfwd
00024 #include "Math/IFunctionfwd.h"
00025 #endif
00026
00027 namespace ROOT {
00028 namespace Math {
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class IRootFinderMethod {
00039 public:
00040
00041 virtual ~IRootFinderMethod() {}
00042
00043
00044 IRootFinderMethod() {}
00045
00046
00047
00048
00049 virtual bool SetFunction(const ROOT::Math::IGradFunction&, double)
00050 {
00051 MATH_ERROR_MSG("SetFunction", "This method must be used with a Root Finder algorithm using derivatives");
00052 return false;
00053 }
00054
00055
00056
00057 virtual bool SetFunction(const ROOT::Math::IGenFunction& , double , double )
00058 {
00059 MATH_ERROR_MSG("SetFunction", "Algorithm requires derivatives");
00060 return false;
00061 }
00062
00063
00064 virtual double Root() const = 0;
00065
00066
00067 virtual int Status() const = 0;
00068
00069
00070
00071
00072
00073
00074
00075
00076 virtual bool Solve(int maxIter = 100, double absTol = 1E-8, double relTol = 1E-10) = 0;
00077
00078
00079 virtual const char* Name() const = 0;
00080
00081
00082
00083 virtual int Iterate() {
00084 MATH_ERROR_MSG("Iterate", "This method must be used with a Root Finder algorithm wrapping the GSL Library");
00085 return -1;
00086 }
00087
00088
00089
00090
00091 virtual int Iterations() const { return -1; }
00092
00093 };
00094
00095 }
00096 }
00097
00098
00099 #endif