ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCL::RootFinder Namespace Reference

Classes

class  Solution
 

Functions

Solution solve (RootFunctor const *const f, const G4double x0)
 Numerically solve a one-dimensional equation.
 

Function Documentation

Solution G4INCL::RootFinder::solve ( RootFunctor const *const  f,
const G4double  x0 
)

Numerically solve a one-dimensional equation.

Numerically solves the equation f(x)==0. This implementation uses the false-position method.

If a root is found, it can be retrieved using the getSolution() method,

Parameters
fpointer to a RootFunctor
x0initial value of the function argument
Returns
a Solution object describing the root, if it was found

Definition at line 118 of file G4INCLRootFinder.cc.

View newest version in sPHENIX GitHub at line 118 of file G4INCLRootFinder.cc

References kdfinder::abs(), G4INCL::RootFunctor::cleanUp(), INCL_DEBUG, G4INCL::Math::sign(), x, x1, x2, y, y1, and y2.

Referenced by G4INCL::InteractionAvatar::enforceEnergyConservation(), G4INCL::ParticleEntryChannel::particleEnters(), and G4INCL::INCL::rescaleOutgoingForRecoil().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: