001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     *
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     *
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    
018    package org.apache.commons.math3.analysis.solvers;
019    
020    
021    /**
022     * Implements the <em>Illinois</em> method for root-finding (approximating
023     * a zero of a univariate real function). It is a modified
024     * {@link RegulaFalsiSolver <em>Regula Falsi</em>} method.
025     *
026     * <p>Like the <em>Regula Falsi</em> method, convergence is guaranteed by
027     * maintaining a bracketed solution. The <em>Illinois</em> method however,
028     * should converge much faster than the original <em>Regula Falsi</em>
029     * method. Furthermore, this implementation of the <em>Illinois</em> method
030     * should not suffer from the same implementation issues as the <em>Regula
031     * Falsi</em> method, which may fail to convergence in certain cases.</p>
032     *
033     * <p>The <em>Illinois</em> method assumes that the function is continuous,
034     * but not necessarily smooth.</p>
035     *
036     * <p>Implementation based on the following article: M. Dowell and P. Jarratt,
037     * <em>A modified regula falsi method for computing the root of an
038     * equation</em>, BIT Numerical Mathematics, volume 11, number 2,
039     * pages 168-174, Springer, 1971.</p>
040     *
041     * @since 3.0
042     * @version $Id: IllinoisSolver.java 1364387 2012-07-22 18:14:11Z tn $
043     */
044    public class IllinoisSolver extends BaseSecantSolver {
045    
046        /** Construct a solver with default accuracy (1e-6). */
047        public IllinoisSolver() {
048            super(DEFAULT_ABSOLUTE_ACCURACY, Method.ILLINOIS);
049        }
050    
051        /**
052         * Construct a solver.
053         *
054         * @param absoluteAccuracy Absolute accuracy.
055         */
056        public IllinoisSolver(final double absoluteAccuracy) {
057            super(absoluteAccuracy, Method.ILLINOIS);
058        }
059    
060        /**
061         * Construct a solver.
062         *
063         * @param relativeAccuracy Relative accuracy.
064         * @param absoluteAccuracy Absolute accuracy.
065         */
066        public IllinoisSolver(final double relativeAccuracy,
067                              final double absoluteAccuracy) {
068            super(relativeAccuracy, absoluteAccuracy, Method.ILLINOIS);
069        }
070    
071        /**
072         * Construct a solver.
073         *
074         * @param relativeAccuracy Relative accuracy.
075         * @param absoluteAccuracy Absolute accuracy.
076         * @param functionValueAccuracy Maximum function value error.
077         */
078        public IllinoisSolver(final double relativeAccuracy,
079                              final double absoluteAccuracy,
080                              final double functionValueAccuracy) {
081            super(relativeAccuracy, absoluteAccuracy, functionValueAccuracy, Method.PEGASUS);
082        }
083    }