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

False Position algorithm based on linear interpolation.

See the GSL manual for more information

Definition at line 72 of file RootFinderAlgorithms.h.

Public Types

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

Public Member Functions

 FalsePos ()
 ~FalsePos () override
int Iterate () override
 This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return an error if it's not one of them.
int Iterations () const override
 Return number of iterations.
const char * Name () const override
 double GSLRootFinder::XLower() const { return fXlow; }
double Root () const override
 Returns the previously calculated root.
bool SetFunction (const IGenFunction &f, double xlow, double xup) override
 Sets the function for the rest of the algorithms.
virtual bool SetFunction (const ROOT::Math::IGradFunction &, double)
 Sets the function for algorithms using derivatives.
bool SetFunction (GSLFuncPointer f, void *params, double xlow, double xup)
bool Solve (int maxIter=100, double absTol=1E-8, double relTol=1E-10) override
 Find the root.
int Status () const override
 Return the status of last root finding.

Protected Member Functions

void FreeSolver ()
void SetSolver (GSLRootFSolver *s)

Private Attributes

GSLFunctionWrapperfFunction
int fIter
double fRoot
GSLRootFSolverfS
int fStatus
bool fValidInterval
double fXlow
double fXup

#include <Math/RootFinderAlgorithms.h>

Inheritance diagram for ROOT::Math::Roots::FalsePos:
ROOT::Math::GSLRootFinder ROOT::Math::IRootFinderMethod

Member Typedef Documentation

◆ GSLFuncPointer

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

Definition at line 94 of file GSLRootFinder.h.

Constructor & Destructor Documentation

◆ FalsePos()

ROOT::Math::Roots::FalsePos::FalsePos ( )

Definition at line 61 of file RootFinderAlgorithms.cxx.

◆ ~FalsePos()

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

Definition at line 68 of file RootFinderAlgorithms.cxx.

Member Function Documentation

◆ FreeSolver()

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

Definition at line 101 of file GSLRootFinder.cxx.

◆ Iterate()

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

This method is implemented only by the GSLRootFinder and GSLRootFinderDeriv classes and will return an error if it's not one of them.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 106 of file GSLRootFinder.cxx.

◆ Iterations()

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

Return number of iterations.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 112 of file GSLRootFinder.h.

◆ Name()

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

double GSLRootFinder::XLower() const { return fXlow; }

double GSLRootFinder::XUpper() const { return fXup; }

Implements ROOT::Math::IRootFinderMethod.

Definition at line 147 of file GSLRootFinder.cxx.

◆ Root()

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

Returns the previously calculated root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 134 of file GSLRootFinder.cxx.

◆ SetFunction() [1/3]

bool ROOT::Math::GSLRootFinder::SetFunction ( const IGenFunction & ,
double ,
double  )
overridevirtualinherited

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 81 of file GSLRootFinder.cxx.

◆ SetFunction() [2/3]

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

Sets the function for algorithms using derivatives.

Reimplemented from ROOT::Math::IRootFinderMethod.

Definition at line 45 of file IRootFinderMethod.h.

◆ SetFunction() [3/3]

bool ROOT::Math::GSLRootFinder::SetFunction ( GSLFuncPointer f,
void * params,
double xlow,
double xup )
inherited

Definition at line 65 of file GSLRootFinder.cxx.

◆ SetSolver()

void ROOT::Math::GSLRootFinder::SetSolver ( GSLRootFSolver * s)
protectedinherited

Definition at line 96 of file GSLRootFinder.cxx.

◆ Solve()

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

Find the root.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 152 of file GSLRootFinder.cxx.

◆ Status()

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

Return the status of last root finding.

Implements ROOT::Math::IRootFinderMethod.

Definition at line 117 of file GSLRootFinder.h.

Member Data Documentation

◆ fFunction

GSLFunctionWrapper* ROOT::Math::GSLRootFinder::fFunction
privateinherited

Definition at line 131 of file GSLRootFinder.h.

◆ fIter

int ROOT::Math::GSLRootFinder::fIter
privateinherited

Definition at line 137 of file GSLRootFinder.h.

◆ fRoot

double ROOT::Math::GSLRootFinder::fRoot
privateinherited

Definition at line 134 of file GSLRootFinder.h.

◆ fS

GSLRootFSolver* ROOT::Math::GSLRootFinder::fS
privateinherited

Definition at line 132 of file GSLRootFinder.h.

◆ fStatus

int ROOT::Math::GSLRootFinder::fStatus
privateinherited

Definition at line 138 of file GSLRootFinder.h.

◆ fValidInterval

bool ROOT::Math::GSLRootFinder::fValidInterval
privateinherited

Definition at line 139 of file GSLRootFinder.h.

◆ fXlow

double ROOT::Math::GSLRootFinder::fXlow
privateinherited

Definition at line 135 of file GSLRootFinder.h.

◆ fXup

double ROOT::Math::GSLRootFinder::fXup
privateinherited

Definition at line 136 of file GSLRootFinder.h.


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