[root] / trunk / math / mathcore / inc / Math / RootFinder.h Repository:
ViewVC logotype

Diff of /trunk/math/mathcore/inc/Math/RootFinder.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25485, Mon Sep 22 07:52:52 2008 UTC revision 25486, Mon Sep 22 12:43:03 2008 UTC
# Line 130  Line 130 
130              return fSolver->SetFunction( f, xstart);              return fSolver->SetFunction( f, xstart);
131           }           }
132    
133             template<class Function, class Derivative>
134             int Solve(Function f, Derivative d, double start,
135                       int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6);
136    
137             template<class Function>
138             int Solve(Function f, double min, double max,
139                       int maxIter = 100, double absTol = 1E-3, double relTol = 1E-6);
140    
141           /**           /**
142               Compute the roots iterating until the estimate of the Root is within the required tolerance returning               Compute the roots iterating until the estimate of the Root is within the required tolerance returning
143               the iteration Status               the iteration Status
# Line 219  Line 227 
227  } // namespace ROOT  } // namespace ROOT
228    
229    
230    #include "Math/WrappedFunction.h"
231    #include "Math/Functor.h"
232    
233    template<class Function, class Derivative>
234    int ROOT::Math::RootFinder::Solve(Function f, Derivative d, double start,
235                                      int maxIter, double absTol, double relTol)
236    {
237       ROOT::Math::GradFunctor1D wf(f, d);
238       if (fSolver) fSolver->SetFunction(wf, start);
239       return Solve(maxIter, absTol, relTol);
240    }
241    
242    template<class Function>
243    int ROOT::Math::RootFinder::Solve(Function f, double min, double max,
244                                      int maxIter, double absTol, double relTol)
245    {
246       ROOT::Math::WrappedFunction<Function> wf(f);
247       if (fSolver) fSolver->SetFunction(wf, min, max);
248       return Solve(maxIter, absTol, relTol);
249    }
250    
251  #endif /* ROOT_Math_RootFinder */  #endif /* ROOT_Math_RootFinder */

Legend:
Removed from v.25485  
changed lines
  Added in v.25486

Subversion Admin
ViewVC Help
Powered by ViewVC 1.0.9