Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches

Secant algorithm, simplified version of Newton method, which does not require the derivative at every step.

See the GSL manual for more information

Definition at line 130 of file RootFinderAlgorithms.h.

Public Types

typedef void(* GSLFdFPointer) (double, void *, double *, double *)
typedef double(* GSLFuncPointer) (double, void *)

Public Member Functions

 Secant ()
 ~Secant () override
int Iterate () override
 iterate (return GSL_SUCCESS in case of successful iteration)
int Iterations () const override
 Return number of iterations.
const char * Name () const override
 Return name of root finder algorithm.
double Root () const override
 Returns the previously calculated root.
bool SetFunction (const IGradFunction &f, double xstart) override
 Sets the function for algorithms using derivatives.
virtual bool SetFunction (const ROOT::Math::IGenFunction &, double, double)
 Sets the function for the rest of the algorithms.
bool SetFunction (GSLFuncPointer f, GSLFuncPointer df, GSLFdFPointer fdf, void *p, double Root)
bool Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) override
 Find the root (return false if failed).
int Status () const override
 Return the status of last root finding.

Protected Member Functions

void FreeSolver ()
void SetSolver (GSLRootFdFSolver *s)

Private Attributes

GSLFunctionDerivWrapperfFunction
int fIter
double fPrevRoot
double fRoot
GSLRootFdFSolverfS
int fStatus
bool fValidPoint

#include <Math/RootFinderAlgorithms.h>

Inheritance diagram for ROOT::Math::Roots::Secant:
ROOT::Math::GSLRootFinderDeriv ROOT::Math::IRootFinderMethod

Member Typedef Documentation

◆ GSLFdFPointer

typedef void(* ROOT::Math::GSLRootFinderDeriv::GSLFdFPointer) (double, void *, double *, double *)
inherited

Definition at line 100 of file GSLRootFinderDeriv.h.

◆ GSLFuncPointer

typedef double(* ROOT::Math::GSLRootFinderDeriv::GSLFuncPointer) (double, void *)
inherited

Definition at line 99 of file GSLRootFinderDeriv.h.

Constructor & Destructor Documentation

◆ Secant()

ROOT::Math::Roots::Secant::Secant ( )

Definition at line 111 of file RootFinderAlgorithms.cxx.

◆ ~Secant()

ROOT::Math::Roots::Secant::~Secant ( )
override

Definition at line 118 of file RootFinderAlgorithms.cxx.

Member Function Documentation

◆ FreeSolver()

void ROOT::Math::GSLRootFinderDeriv::FreeSolver ( )
protectedinherited

Definition at line 88 of file GSLRootFinderDeriv.cxx.

◆ Iterate()

int ROOT::Math::GSLRootFinderDeriv::Iterate ( )
overridevirtualinherited

iterate (return GSL_SUCCESS in case of successful iteration)

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 93 of file GSLRootFinderDeriv.cxx.

◆ Iterations()

int ROOT::Math::GSLRootFinderDeriv::Iterations ( ) const
inlineoverridevirtualinherited

Return number of iterations.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 114 of file GSLRootFinderDeriv.h.

◆ Name()

const char * ROOT::Math::GSLRootFinderDeriv::Name ( ) const
overridevirtualinherited

Return name of root finder algorithm.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 118 of file GSLRootFinderDeriv.cxx.

◆ Root()

double ROOT::Math::GSLRootFinderDeriv::Root ( ) const
overridevirtualinherited

Returns the previously calculated root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 113 of file GSLRootFinderDeriv.cxx.

◆ SetFunction() [1/3]

bool ROOT::Math::GSLRootFinderDeriv::SetFunction ( const IGradFunction & ,
double  )
inlineoverridevirtualinherited

Sets the function for algorithms using derivatives.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 93 of file GSLRootFinderDeriv.h.

◆ SetFunction() [2/3]

virtual bool ROOT::Math::IRootFinderMethod::SetFunction ( const ROOT::Math::IGenFunction & ,
double ,
double  )
inlinevirtualinherited

Sets the function for the rest of the algorithms.

The parameters set the interval where the root has to be calculated.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 53 of file IRootFinderMethod.h.

◆ SetFunction() [3/3]

bool ROOT::Math::GSLRootFinderDeriv::SetFunction ( GSLFuncPointer f,
GSLFuncPointer df,
GSLFdFPointer fdf,
void * p,
double Root )
inherited

Definition at line 65 of file GSLRootFinderDeriv.cxx.

◆ SetSolver()

void ROOT::Math::GSLRootFinderDeriv::SetSolver ( GSLRootFdFSolver * s)
protectedinherited

Definition at line 83 of file GSLRootFinderDeriv.cxx.

◆ Solve()

bool ROOT::Math::GSLRootFinderDeriv::Solve ( int maxIter = 100,
double absTol = 1E-8,
double relTol = 1E-10 )
overridevirtualinherited

Find the root (return false if failed).

Implements ROOT::Math::IRootFinderMethod.

Definition at line 123 of file GSLRootFinderDeriv.cxx.

◆ Status()

int ROOT::Math::GSLRootFinderDeriv::Status ( ) const
inlineoverridevirtualinherited

Return the status of last root finding.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 119 of file GSLRootFinderDeriv.h.

Member Data Documentation

◆ fFunction

GSLFunctionDerivWrapper* ROOT::Math::GSLRootFinderDeriv::fFunction
privateinherited

Definition at line 131 of file GSLRootFinderDeriv.h.

◆ fIter

int ROOT::Math::GSLRootFinderDeriv::fIter
privateinherited

Definition at line 136 of file GSLRootFinderDeriv.h.

◆ fPrevRoot

double ROOT::Math::GSLRootFinderDeriv::fPrevRoot
mutableprivateinherited

Definition at line 135 of file GSLRootFinderDeriv.h.

◆ fRoot

double ROOT::Math::GSLRootFinderDeriv::fRoot
mutableprivateinherited

Definition at line 134 of file GSLRootFinderDeriv.h.

◆ fS

GSLRootFdFSolver* ROOT::Math::GSLRootFinderDeriv::fS
privateinherited

Definition at line 132 of file GSLRootFinderDeriv.h.

◆ fStatus

int ROOT::Math::GSLRootFinderDeriv::fStatus
privateinherited

Definition at line 137 of file GSLRootFinderDeriv.h.

◆ fValidPoint

bool ROOT::Math::GSLRootFinderDeriv::fValidPoint
privateinherited

Definition at line 138 of file GSLRootFinderDeriv.h.


The documentation for this class was generated from the following files: