Class GaussHermiteQuadratureIntegrator1D
- java.lang.Object
-
- com.opengamma.strata.math.impl.integration.Integrator1D<Double,Double>
-
- com.opengamma.strata.math.impl.integration.GaussianQuadratureIntegrator1D
-
- com.opengamma.strata.math.impl.integration.GaussHermiteQuadratureIntegrator1D
-
public class GaussHermiteQuadratureIntegrator1D extends GaussianQuadratureIntegrator1D
Gauss-Hermite quadrature approximates the value of integrals of the form $$ \begin{align*} \int_{-\infty}^{\infty} e^{-x^2} g(x) dx \end{align*} $$ The weights and abscissas are generated byGaussHermiteWeightAndAbscissaFunction
.At present, this integrator can only be used for the limits $\pm\infty$. The function to integrate is scaled in such a way as to allow any values for the limits of integration.
-
-
Constructor Summary
Constructors Constructor Description GaussHermiteQuadratureIntegrator1D(int n)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Function<Double,Double>
getIntegralFunction(Function<Double,Double> function, Double lower, Double upper)
Returns a function that is valid for both the type of quadrature and the limits of integration.Double[]
getLimits()
Gets the limits.-
Methods inherited from class com.opengamma.strata.math.impl.integration.GaussianQuadratureIntegrator1D
equals, hashCode, integrate, integrateFromPolyFunc
-
Methods inherited from class com.opengamma.strata.math.impl.integration.Integrator1D
integrate
-
-
-
-
Method Detail
-
getLimits
public Double[] getLimits()
Gets the limits.- Specified by:
getLimits
in classGaussianQuadratureIntegrator1D
- Returns:
- The lower and upper limits for which the quadrature is valid
-
getIntegralFunction
public Function<Double,Double> getIntegralFunction(Function<Double,Double> function, Double lower, Double upper)
Returns a function that is valid for both the type of quadrature and the limits of integration. The function $f(x)$ that is to be integrated is transformed into a form suitable for this quadrature method using: $$ \begin{align*} \int_{-\infty}^{\infty} f(x) dx &= \int_{-\infty}^{\infty} f(x) e^{x^2} e^{-x^2} dx\\ &= \int_{-\infty}^{\infty} g(x) e^{-x^2} dx \end{align*} $$- Specified by:
getIntegralFunction
in classGaussianQuadratureIntegrator1D
- Parameters:
function
- The function to be integrated, not nulllower
- The lower integration limit, not nullupper
- The upper integration limit, not null- Returns:
- A function in the appropriate form for integration
- Throws:
UnsupportedOperationException
- If the lower limit is not $-\infty$ or the upper limit is not $\infty$
-
-