C# Class Accord.Math.Integration.TrapezoidalRule

Trapezoidal rule for numerical integration.

In numerical analysis, the trapezoidal rule (also known as the trapezoid rule or trapezium rule) is a technique for approximating the definite integral ∫_a^b(x) dx. The trapezoidal rule works by approximating the region under the graph of the function f(x) as a trapezoid and calculating its area. It follows that ∫_a^b(x) dx ~ (b - a) [f(a) - f(b)] / 2.

References: Wikipedia, The Free Encyclopedia. Trapezoidal rule. Available on: http://en.wikipedia.org/wiki/Trapezoidal_rule

Inheritance: INumericalIntegration, IUnivariateIntegration
Show file Open project: accord-net/framework Class Usage Examples

Public Methods

Method Description
Clone ( ) : object

Creates a new object that is a copy of the current instance.

Compute ( ) : bool

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.

Integrate ( double>.Func func, double a, double b, int steps ) : double

Computes the area under the integral for the given function, in the given integration interval, using the Trapezoidal rule.

TrapezoidalRule ( ) : System

Constructs a new TrapezoidalRule integration method.

TrapezoidalRule ( double>.Func function ) : System

Constructs a new TrapezoidalRule integration method.

TrapezoidalRule ( double>.Func function, double a, double b ) : System

Constructs a new TrapezoidalRule integration method.

TrapezoidalRule ( int steps ) : System

Constructs a new TrapezoidalRule integration method.

TrapezoidalRule ( int steps, double>.Func function ) : System

Constructs a new TrapezoidalRule integration method.

TrapezoidalRule ( int steps, double>.Func function, double a, double b ) : System

Constructs a new TrapezoidalRule integration method.

Method Details

Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object

Compute() public method

Computes the area of the function under the selected Range. The computed value will be available at this object's Area.
public Compute ( ) : bool
return bool

Integrate() public static method

Computes the area under the integral for the given function, in the given integration interval, using the Trapezoidal rule.
public static Integrate ( double>.Func func, double a, double b, int steps ) : double
func double>.Func The unidimensional function whose integral should be computed.
a double The beginning of the integration interval.
b double The ending of the integration interval.
steps int The number of steps into which the integration interval will be divided.
return double

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( ) : System
return System

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( double>.Func function ) : System
function double>.Func The unidimensional function whose integral should be computed.
return System

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( double>.Func function, double a, double b ) : System
function double>.Func The unidimensional function whose integral should be computed.
a double The beginning of the integration interval.
b double The ending of the integration interval.
return System

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( int steps ) : System
steps int The number of steps into which the integration /// interval will be divided.
return System

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( int steps, double>.Func function ) : System
steps int The number of steps into which the integration /// interval will be divided.
function double>.Func The unidimensional function /// whose integral should be computed.
return System

TrapezoidalRule() public method

Constructs a new TrapezoidalRule integration method.
public TrapezoidalRule ( int steps, double>.Func function, double a, double b ) : System
steps int The number of steps into which the integration /// interval will be divided.
function double>.Func The unidimensional function /// whose integral should be computed.
a double The beginning of the integration interval.
b double The ending of the integration interval.
return System