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
018package 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 */
043public class IllinoisSolver extends BaseSecantSolver {
044
045    /** Construct a solver with default accuracy (1e-6). */
046    public IllinoisSolver() {
047        super(DEFAULT_ABSOLUTE_ACCURACY, Method.ILLINOIS);
048    }
049
050    /**
051     * Construct a solver.
052     *
053     * @param absoluteAccuracy Absolute accuracy.
054     */
055    public IllinoisSolver(final double absoluteAccuracy) {
056        super(absoluteAccuracy, Method.ILLINOIS);
057    }
058
059    /**
060     * Construct a solver.
061     *
062     * @param relativeAccuracy Relative accuracy.
063     * @param absoluteAccuracy Absolute accuracy.
064     */
065    public IllinoisSolver(final double relativeAccuracy,
066                          final double absoluteAccuracy) {
067        super(relativeAccuracy, absoluteAccuracy, Method.ILLINOIS);
068    }
069
070    /**
071     * Construct a solver.
072     *
073     * @param relativeAccuracy Relative accuracy.
074     * @param absoluteAccuracy Absolute accuracy.
075     * @param functionValueAccuracy Maximum function value error.
076     */
077    public IllinoisSolver(final double relativeAccuracy,
078                          final double absoluteAccuracy,
079                          final double functionValueAccuracy) {
080        super(relativeAccuracy, absoluteAccuracy, functionValueAccuracy, Method.PEGASUS);
081    }
082}