Logo ROOT  
Reference Guide
RootFinderAlgorithms.cxx
Go to the documentation of this file.
1 // @(#)root/mathmore:$Id$
2 // Authors: L. Moneta, A. Zsenei 08/2005
3 
4  /**********************************************************************
5  * *
6  * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT *
7  * *
8  * This library is free software; you can redistribute it and/or *
9  * modify it under the terms of the GNU General Public License *
10  * as published by the Free Software Foundation; either version 2 *
11  * of the License, or (at your option) any later version. *
12  * *
13  * This library is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16  * General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this library (see file COPYING); if not, write *
20  * to the Free Software Foundation, Inc., 59 Temple Place, Suite *
21  * 330, Boston, MA 02111-1307 USA, or contact the author. *
22  * *
23  **********************************************************************/
24 
25 // Implementation file for class GSLRootFinderAlgorithms
26 //
27 // Created by: moneta at Sun Nov 14 14:07:50 2004
28 //
29 // Last update: Sun Nov 14 14:07:50 2004
30 //
31 
33 #include "GSLRootFSolver.h"
34 #include "GSLRootFdFSolver.h"
35 
36 #include "gsl/gsl_roots.h"
37 
38 namespace ROOT {
39 namespace Math {
40 
41 
42 namespace Roots {
43 
44 
45 
47 {
48  // Bisection constructor
49  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_bisection );
50  SetSolver(s);
51 }
52 
54 {
55  // destructor
56  FreeSolver();
57 }
58 
60 {
61  // dummy copy ctr
62 }
63 
65 {
66  // dummy (private) operator=
67  if (this == &rhs) return *this; // time saving self-test
68  return *this;
69 }
70 
71 
72 // falsepos method
73 
75 {
76  // FalsePos constructor
77  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_falsepos );
78  SetSolver(s);
79 }
80 
82 {
83  // destructor
84  FreeSolver();
85 }
86 
88 {
89  // dummy copy ctr
90 }
91 
93 {
94  // dummy (private) operator=
95  if (this == &rhs) return *this; // time saving self-test
96  return *this;
97 }
98 
99 // Brent method
100 
102 {
103  // Brent constructor
104  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_brent );
105  SetSolver(s);
106 }
107 
109 {
110  // destructor
111  FreeSolver();
112 }
113 
115 {
116  // dummy copy ctr
117 }
118 
120 {
121  // dummy (private) operator=
122  if (this == &rhs) return *this; // time saving self-test
123  return *this;
124 }
125 
126 
127 //---------------------------------------------------------------------
128 // algorithms with Derivatives
129 //--------------------------------------------------------------------
130 
131 // Newton
132 
134 {
135  // Newton constructor
136  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_newton );
137  SetSolver(s);
138 }
139 
141 {
142  // destructor
143  FreeSolver();
144 }
145 
147 {
148  // dummy copy ctr
149 }
150 
152 {
153  // dummy (private) operator=
154  if (this == &rhs) return *this; // time saving self-test
155  return *this;
156 }
157 
158 // Secant
159 
161 {
162  // Secant constructor
163  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_secant );
164  SetSolver(s);
165 }
166 
168 {
169  // destructor
170  FreeSolver();
171 }
172 
174 {
175  // dummy copy ctr
176 }
177 
179 {
180  // dummy (private) operator=
181  if (this == &rhs) return *this; // time saving self-test
182  return *this;
183 }
184 
185 // Steffenson
186 
188 {
189  // Steffenson constructor
190  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_steffenson );
191  SetSolver(s);
192 }
193 
195 {
196  // destructor
197  FreeSolver();
198 }
199 
201 {
202  // dummy copy ctr
203 }
204 
206 {
207  // dummy (private) operator=
208  if (this == &rhs) return *this; // time saving self-test
209  return *this;
210 }
211 
212 
213 
214 } // end namespace GSLRoots
215 
216 } // namespace Math
217 } // namespace ROOT
ROOT::Math::GSLRootFinder
Base class for GSL Root-Finding algorithms for one dimensional functions which do not use function de...
Definition: GSLRootFinder.h:73
GSLRootFSolver.h
ROOT::Math::Roots::Brent::Brent
Brent()
Definition: RootFinderAlgorithms.cxx:101
ROOT::Math::Roots::Bisection::operator=
Bisection & operator=(const Bisection &)
Definition: RootFinderAlgorithms.cxx:64
GSLRootFdFSolver.h
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
RootFinderAlgorithms.h
ROOT::Math::Roots::Newton
a Newton algorithm, which computes the derivative at each iteration See the GSL manual for more infor...
Definition: RootFinderAlgorithms.h:132
ROOT::Math::Roots::Steffenson
Steffenson method, providing the fastes convergence.
Definition: RootFinderAlgorithms.h:178
ROOT::Math::Roots::Steffenson::Steffenson
Steffenson()
Definition: RootFinderAlgorithms.cxx:187
ROOT::Math::Roots::FalsePos
False Position algorithm based on linear interpolation.
Definition: RootFinderAlgorithms.h:79
ROOT::Math::Roots::Bisection::~Bisection
virtual ~Bisection()
Definition: RootFinderAlgorithms.cxx:53
ROOT::Math::Roots::Brent::operator=
Brent & operator=(const Brent &)
Definition: RootFinderAlgorithms.cxx:119
ROOT::Math::Roots::Steffenson::operator=
Steffenson & operator=(const Steffenson &)
Definition: RootFinderAlgorithms.cxx:205
ROOT::Math::Roots::Secant
Secant algorithm, simplified version of Newton method, which does not require the derivative at every...
Definition: RootFinderAlgorithms.h:155
ROOT::Math::Roots::FalsePos::~FalsePos
virtual ~FalsePos()
Definition: RootFinderAlgorithms.cxx:81
ROOT::Math::Roots::FalsePos::operator=
FalsePos & operator=(const FalsePos &)
Definition: RootFinderAlgorithms.cxx:92
ROOT::Math::Roots::Brent::~Brent
virtual ~Brent()
Definition: RootFinderAlgorithms.cxx:108
ROOT::Math::Roots::Secant::~Secant
virtual ~Secant()
Definition: RootFinderAlgorithms.cxx:167
ROOT::Math::GSLRootFinder::SetSolver
void SetSolver(GSLRootFSolver *s)
Definition: GSLRootFinder.cxx:108
ROOT::Math::Roots::Newton::~Newton
virtual ~Newton()
Definition: RootFinderAlgorithms.cxx:140
ROOT::Math::GSLRootFSolver
Root-Finder implementation class using GSL.
Definition: GSLRootFSolver.h:47
ROOT::Math::Roots::FalsePos::FalsePos
FalsePos()
Definition: RootFinderAlgorithms.cxx:74
ROOT::Math::Roots::Bisection
Roots::Bisection Bisection algorithm, simplest algorithm for bracketing the roots of a function,...
Definition: RootFinderAlgorithms.h:57
ROOT::Math::Roots::Secant::Secant
Secant()
Definition: RootFinderAlgorithms.cxx:160
ROOT::Math::GSLRootFinderDeriv::FreeSolver
void FreeSolver()
Definition: GSLRootFinderDeriv.cxx:102
ROOT::Math::GSLRootFinder::FreeSolver
void FreeSolver()
Definition: GSLRootFinder.cxx:113
ROOT::Math::Roots::Secant::operator=
Secant & operator=(const Secant &)
Definition: RootFinderAlgorithms.cxx:178
ROOT::Math::Roots::Newton::Newton
Newton()
Definition: RootFinderAlgorithms.cxx:133
ROOT::Math::Roots::Newton::operator=
Newton & operator=(const Newton &)
Definition: RootFinderAlgorithms.cxx:151
ROOT::Math::Roots::Steffenson::~Steffenson
virtual ~Steffenson()
Definition: RootFinderAlgorithms.cxx:194
ROOT::Math::Roots::Bisection::Bisection
Bisection()
Definition: RootFinderAlgorithms.cxx:46
ROOT::Math::GSLRootFinderDeriv
Base class for GSL Root-Finding algorithms for one dimensional functions which use function derivativ...
Definition: GSLRootFinderDeriv.h:74
ROOT::Math::GSLRootFinderDeriv::SetSolver
void SetSolver(GSLRootFdFSolver *s)
Definition: GSLRootFinderDeriv.cxx:97
ROOT
VSD Structures.
Definition: StringConv.hxx:21
ROOT::Math::GSLRootFdFSolver
Root-Finder with derivatives implementation class using GSL.
Definition: GSLRootFdFSolver.h:47
Math
Namespace for new Math classes and functions.
ROOT::Math::Roots::Brent
Brent-Dekker algorithm which combines an interpolation strategy with the bisection algorithm See the ...
Definition: RootFinderAlgorithms.h:104