## Class ExtendedTrapezoidIntegrator1D

• All Implemented Interfaces:
Integrator<Double,​Double,​Function<Double,​Double>>

public class ExtendedTrapezoidIntegrator1D
extends Integrator1D<Double,​Double>
The trapezoid integration rule is a two-point Newton-Cotes formula that approximates the area under the curve as a trapezoid. For a function $f(x)$, \begin{align*} \int^{x_2} _{x_1} f(x)dx \approx \frac{1}{2}(x_2 - x_1)(f(x_1) + f(x_2)) \end{align*}

This class is a wrapper for the Commons Math library implementation of trapezoidal integration.

• ### Constructor Summary

Constructors
Constructor Description
ExtendedTrapezoidIntegrator1D()
• ### Method Summary

All Methods
Modifier and Type Method Description
Double integrate​(Function<Double,​Double> f, Double lower, Double upper)
Trapezoid integration method.
• ### Methods inherited from class com.opengamma.strata.math.impl.integration.Integrator1D

integrate
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### ExtendedTrapezoidIntegrator1D

public ExtendedTrapezoidIntegrator1D()
• ### Method Detail

• #### integrate

public Double integrate​(Function<Double,​Double> f,
Double lower,
Double upper)
Trapezoid integration method. Note that the Commons implementation fails if the lower bound is larger than the upper - in this case, the bounds are reversed and the result negated. 1-D integration method.
Specified by:
integrate in class Integrator1D<Double,​Double>
Parameters:
f - The function to integrate, not null
lower - The lower bound, not null
upper - The upper bound, not null
Returns:
The result of the integration