Root Finder Algorithms

Class structure for Root Finder methods

The next image shows the classes provided in ROOT to calculate the root of a function. They all work with functions in one dimension, although some methods need also to calculate the derivative of the functions. All the methods, except the one implemented in BrentRootFinder are taken from the GSL library.

Root Finder algorithms class hierarchy

Using an existing Root Finder method

Using the class directly

The classes shown in the previous diagram are described and used as follows:

  • BrentRootFinder: This is the only class that is implemented without wrapping methods from GSL. It implements the Brent method to find the root of a given function. Example:
  • GSLRootFinder: This class is only a helper for the classes that derivate from it. It should not be used directly, as the next three classes handle all the missing behaviour. All the classes deriving from this just wrap the different GSL methods that do not need to use the derivative to find the root of the given function.
  • ROOT::Math::Roots::Brent: Wraps the Brent method implemented in the GSL into the GSLRootFinder class. Example:
  • ROOT::Math::Roots::Bisection: Wraps the bisection method implemented in the GSL into the GSLRootFinder. Example:
  • ROOT::Math::Roots::FalsePos: Wraps the false postion method implemented in the GSL into the GSLRootFinder class. Example:
  • GSLRootFinderDeriv::Base class for GSL Root-Finding algorithms for one dimensional functions which use function derivatives. As with GSLRootFinder users should not use this class directly but instantiate the template ROOT::Math::RootFinder class with the corresponding algorithms.
  • ROOT::Math::Roots::Newton:Wraps the Newton method implemented in the GSL. Example:
  • ROOT::Math::Roots::Secant:Wraps the Secant method implemented in the GSL. Example:
  • ROOT::Math::Roots::Steffenson::Wraps the Steffenson method implemented in the GSL. Example:

Using the Plug-In Mananger

As with the other numerical algorithms in ROOT, there is the possibility of avoinding the use of all the low lever classes through the plug-in manager. Using the class ROOT::Math::RootFinder we can just create any of the existing methods through its constructor and work with it as if we where working with a IRootFinderMethod. Example:

How to implement your own Integrator

Pending of confirmation to do!