public class GaussIntegratorFactory
extends java.lang.Object
Gaussian integration rule
.Modifier and Type | Field and Description |
---|---|
private BaseRuleFactory<java.lang.Double> |
hermite
Generator of Gauss-Hermite integrators.
|
private BaseRuleFactory<java.lang.Double> |
legendre
Generator of Gauss-Legendre integrators.
|
private BaseRuleFactory<java.math.BigDecimal> |
legendreHighPrecision
Generator of Gauss-Legendre integrators.
|
Constructor and Description |
---|
GaussIntegratorFactory() |
Modifier and Type | Method and Description |
---|---|
private static Pair<double[],double[]> |
getRule(BaseRuleFactory<? extends java.lang.Number> factory,
int numberOfPoints) |
SymmetricGaussIntegrator |
hermite(int numberOfPoints)
Creates a Gauss-Hermite integrator of the given order.
|
GaussIntegrator |
legendre(int numberOfPoints)
Creates a Gauss-Legendre integrator of the given order.
|
GaussIntegrator |
legendre(int numberOfPoints,
double lowerBound,
double upperBound)
Creates a Gauss-Legendre integrator of the given order.
|
GaussIntegrator |
legendreHighPrecision(int numberOfPoints)
Creates a Gauss-Legendre integrator of the given order.
|
GaussIntegrator |
legendreHighPrecision(int numberOfPoints,
double lowerBound,
double upperBound)
Creates an integrator of the given order, and whose call to the
integrate method will perform an integration on the given interval. |
private static Pair<double[],double[]> |
transform(Pair<double[],double[]> rule,
double a,
double b)
Performs a change of variable so that the integration can be performed
on an arbitrary interval
[a, b] . |
private final BaseRuleFactory<java.lang.Double> legendre
private final BaseRuleFactory<java.math.BigDecimal> legendreHighPrecision
private final BaseRuleFactory<java.lang.Double> hermite
public GaussIntegrator legendre(int numberOfPoints)
integrate
method will perform an integration on the natural interval
[-1 , 1]
.numberOfPoints
- Order of the integration rule.public GaussIntegrator legendre(int numberOfPoints, double lowerBound, double upperBound) throws NotStrictlyPositiveException
integrate
method will perform an integration on the given interval.numberOfPoints
- Order of the integration rule.lowerBound
- Lower bound of the integration interval.upperBound
- Upper bound of the integration interval.NotStrictlyPositiveException
- if number of points is not positivepublic GaussIntegrator legendreHighPrecision(int numberOfPoints) throws NotStrictlyPositiveException
integrate
method will perform an integration on the natural interval
[-1 , 1]
.numberOfPoints
- Order of the integration rule.NotStrictlyPositiveException
- if number of points is not positivepublic GaussIntegrator legendreHighPrecision(int numberOfPoints, double lowerBound, double upperBound) throws NotStrictlyPositiveException
integrate
method will perform an integration on the given interval.numberOfPoints
- Order of the integration rule.lowerBound
- Lower bound of the integration interval.upperBound
- Upper bound of the integration interval.NotStrictlyPositiveException
- if number of points is not positivepublic SymmetricGaussIntegrator hermite(int numberOfPoints)
integrate
method will perform a weighted integration on the interval
[-&inf;, +&inf;]
: the computed value is the improper integral of
e-x2 f(x)
where f(x)
is the function passed to the
integrate
method.numberOfPoints
- Order of the integration rule.private static Pair<double[],double[]> getRule(BaseRuleFactory<? extends java.lang.Number> factory, int numberOfPoints) throws NotStrictlyPositiveException, DimensionMismatchException
factory
- Integration rule factory.numberOfPoints
- Order of the integration rule.NotStrictlyPositiveException
- if number of points is not positiveDimensionMismatchException
- if the elements of the rule pair do not
have the same length.private static Pair<double[],double[]> transform(Pair<double[],double[]> rule, double a, double b)
[a, b]
.
It is assumed that the natural interval is [-1, 1]
.rule
- Original points and weights.a
- Lower bound of the integration interval.b
- Lower bound of the integration interval.Copyright (c) 2003-2014 Apache Software Foundation