Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 
46 Bisection::Bisection()
47 {
48  // Bisection constructor
49  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_bisection );
50  SetSolver(s);
51 }
52 
53 Bisection::~Bisection()
54 {
55  // destructor
56  FreeSolver();
57 }
58 
59 Bisection::Bisection(const Bisection &) : GSLRootFinder()
60 {
61  // dummy copy ctr
62 }
63 
64 Bisection & Bisection::operator = (const Bisection &rhs)
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 
74 FalsePos::FalsePos()
75 {
76  // FalsePos constructor
77  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_falsepos );
78  SetSolver(s);
79 }
80 
81 FalsePos::~FalsePos()
82 {
83  // destructor
84  FreeSolver();
85 }
86 
87 FalsePos::FalsePos(const FalsePos &) : GSLRootFinder()
88 {
89  // dummy copy ctr
90 }
91 
92 FalsePos & FalsePos::operator = (const FalsePos &rhs)
93 {
94  // dummy (private) operator=
95  if (this == &rhs) return *this; // time saving self-test
96  return *this;
97 }
98 
99 // Brent method
100 
101 Brent::Brent()
102 {
103  // Brent constructor
104  GSLRootFSolver * s = new GSLRootFSolver( gsl_root_fsolver_brent );
105  SetSolver(s);
106 }
107 
108 Brent::~Brent()
109 {
110  // destructor
111  FreeSolver();
112 }
113 
114 Brent::Brent(const Brent &) : GSLRootFinder()
115 {
116  // dummy copy ctr
117 }
118 
119 Brent & Brent::operator = (const Brent &rhs)
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 
133 Newton::Newton()
134 {
135  // Newton constructor
136  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_newton );
137  SetSolver(s);
138 }
139 
140 Newton::~Newton()
141 {
142  // destructor
143  FreeSolver();
144 }
145 
146 Newton::Newton(const Newton &) : GSLRootFinderDeriv()
147 {
148  // dummy copy ctr
149 }
150 
151 Newton & Newton::operator = (const Newton &rhs)
152 {
153  // dummy (private) operator=
154  if (this == &rhs) return *this; // time saving self-test
155  return *this;
156 }
157 
158 // Secant
159 
160 Secant::Secant()
161 {
162  // Secant constructor
163  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_secant );
164  SetSolver(s);
165 }
166 
167 Secant::~Secant()
168 {
169  // destructor
170  FreeSolver();
171 }
172 
173 Secant::Secant(const Secant &) : GSLRootFinderDeriv()
174 {
175  // dummy copy ctr
176 }
177 
178 Secant & Secant::operator = (const Secant &rhs)
179 {
180  // dummy (private) operator=
181  if (this == &rhs) return *this; // time saving self-test
182  return *this;
183 }
184 
185 // Steffenson
186 
187 Steffenson::Steffenson()
188 {
189  // Steffenson constructor
190  GSLRootFdFSolver * s = new GSLRootFdFSolver( gsl_root_fdfsolver_steffenson );
191  SetSolver(s);
192 }
193 
194 Steffenson::~Steffenson()
195 {
196  // destructor
197  FreeSolver();
198 }
199 
200 Steffenson::Steffenson(const Steffenson &) : GSLRootFinderDeriv()
201 {
202  // dummy copy ctr
203 }
204 
205 Steffenson & Steffenson::operator = (const Steffenson &rhs)
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