1/*2* Licensed to the Apache Software Foundation (ASF) under one or more3* contributor license agreements. See the NOTICE file distributed with4* this work for additional information regarding copyright ownership.5* The ASF licenses this file to You under the Apache License, Version 2.06* (the "License"); you may not use this file except in compliance with7* the License. You may obtain a copy of the License at8*9* http://www.apache.org/licenses/LICENSE-2.010*11* Unless required by applicable law or agreed to in writing, software12* distributed under the License is distributed on an "AS IS" BASIS,13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14* See the License for the specific language governing permissions and15* limitations under the License.16*/17 18packageorg.apache.commons.math3.analysis.solvers; 19 20/**21* Implements the <em>Pegasus</em> method for root-finding (approximating22* a zero of a univariate real function). It is a modified23* {@link RegulaFalsiSolver <em>Regula Falsi</em>} method.24*25* <p>Like the <em>Regula Falsi</em> method, convergence is guaranteed by26* maintaining a bracketed solution. The <em>Pegasus</em> method however,27* should converge much faster than the original <em>Regula Falsi</em>28* method. Furthermore, this implementation of the <em>Pegasus</em> method29* should not suffer from the same implementation issues as the <em>Regula30* Falsi</em> method, which may fail to convergence in certain cases. Also,31* the <em>Pegasus</em> method should converge faster than the32* {@link IllinoisSolver <em>Illinois</em>} method, another <em>Regula33* Falsi</em>-based method.</p>34*35* <p>The <em>Pegasus</em> method assumes that the function is continuous,36* but not necessarily smooth.</p>37*38* <p>Implementation based on the following article: M. Dowell and P. Jarratt,39* <em>The "Pegasus" method for computing the root of an equation</em>,40* BIT Numerical Mathematics, volume 12, number 4, pages 503-508, Springer,41* 1972.</p>42*43* @since 3.044*/45publicclassPegasusSolverextendsBaseSecantSolver { 46 47/** Construct a solver with default accuracy (1e-6). */48publicPegasusSolver() { 49super(DEFAULT_ABSOLUTE_ACCURACY, Method.PEGASUS); 50 } 51 52/**53* Construct a solver.54*55* @param absoluteAccuracy Absolute accuracy.56*/57publicPegasusSolver(finaldoubleabsoluteAccuracy) { 58super(absoluteAccuracy, Method.PEGASUS); 59 } 60 61/**62* Construct a solver.63*64* @param relativeAccuracy Relative accuracy.65* @param absoluteAccuracy Absolute accuracy.66*/67publicPegasusSolver(finaldoublerelativeAccuracy, 68finaldoubleabsoluteAccuracy) { 69super(relativeAccuracy, absoluteAccuracy, Method.PEGASUS); 70 } 71 72/**73* Construct a solver.74*75* @param relativeAccuracy Relative accuracy.76* @param absoluteAccuracy Absolute accuracy.77* @param functionValueAccuracy Maximum function value error.78*/79publicPegasusSolver(finaldoublerelativeAccuracy, 80finaldoubleabsoluteAccuracy, 81finaldoublefunctionValueAccuracy) { 82super(relativeAccuracy, absoluteAccuracy, functionValueAccuracy, Method.PEGASUS); 83 } 84 }