C# Класс Accord.Math.Optimization.BrentSearch

Brent's root finding and minimization algorithms.

In numerical analysis, Brent's method is a complicated but popular root-finding algorithm combining the bisection method, the secant method and inverse quadratic interpolation. It has the reliability of bisection but it can be as quick as some of the less reliable methods. The idea is to use the secant method or inverse quadratic interpolation if possible, because they converge faster, but to fall back to the more robust bisection method if necessary. Brent's method is due to Richard Brent (1973) and builds on an earlier algorithm of Theodorus Dekker (1969).

The algorithms implemented in this class are based on the original C source code available in Netlib (http://www.netlib.org/c/brent.shar) by Oleg Keselyov, 1991.

References: R.P. Brent (1973). Algorithms for Minimization without Derivatives, Chapter 4. Prentice-Hall, Englewood Cliffs, NJ. ISBN 0-13-022335-2. Wikipedia contributors. "Brent's method." Wikipedia, The Free Encyclopedia. Wikipedia, The Free Encyclopedia, 11 May. 2012. Web. 22 Jun. 2012.

Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание

Открытые методы

Метод Описание
BrentSearch ( double>.Func function, double a, double b ) : System

Constructs a new Brent search algorithm.

Find ( double value ) : bool

Attempts to find a value in the interval [a;b]

Find ( double>.Func function, double value, double lowerBound, double upperBound, double tol = 1e-6 ) : double

Finds a value of a function in the interval [a;b]

FindRoot ( ) : bool

Attempts to find a root in the interval [a;b]

FindRoot ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double

Finds the root of a function in the interval [a;b]

Maximize ( ) : bool

Finds the maximum of the function in the interval [a;b]

Maximize ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double

Finds the maximum of a function in the interval [a;b]

Minimize ( ) : bool

Finds the minimum of the function in the interval [a;b]

Minimize ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double

Finds the minimum of a function in the interval [a;b]

Описание методов

BrentSearch() публичный метод

Constructs a new Brent search algorithm.
public BrentSearch ( double>.Func function, double a, double b ) : System
function double>.Func The function to be searched.
a double Start of search region.
b double End of search region.
Результат System

Find() публичный метод

Attempts to find a value in the interval [a;b]
public Find ( double value ) : bool
value double
Результат bool

Find() публичный статический метод

Finds a value of a function in the interval [a;b]
public static Find ( double>.Func function, double value, double lowerBound, double upperBound, double tol = 1e-6 ) : double
function double>.Func The function to have its root computed.
value double The value to be looked for in the function.
lowerBound double Start of search region.
upperBound double End of search region.
tol double The tolerance for determining the solution.
Результат double

FindRoot() публичный метод

Attempts to find a root in the interval [a;b]
public FindRoot ( ) : bool
Результат bool

FindRoot() публичный статический метод

Finds the root of a function in the interval [a;b]
public static FindRoot ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double
function double>.Func The function to have its root computed.
lowerBound double Start of search region.
upperBound double End of search region.
tol double The tolerance for determining the solution.
Результат double

Maximize() публичный метод

Finds the maximum of the function in the interval [a;b]
public Maximize ( ) : bool
Результат bool

Maximize() публичный статический метод

Finds the maximum of a function in the interval [a;b]
public static Maximize ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double
function double>.Func The function to be maximized.
lowerBound double Start of search region.
upperBound double End of search region.
tol double The tolerance for determining the solution.
Результат double

Minimize() публичный метод

Finds the minimum of the function in the interval [a;b]
public Minimize ( ) : bool
Результат bool

Minimize() публичный статический метод

Finds the minimum of a function in the interval [a;b]
public static Minimize ( double>.Func function, double lowerBound, double upperBound, double tol = 1e-6 ) : double
function double>.Func The function to be minimized.
lowerBound double Start of search region.
upperBound double End of search region.
tol double The tolerance for determining the solution.
Результат double