Class LegendreHighPrecisionRuleFactory
java.lang.Object
org.apache.commons.math3.analysis.integration.gauss.BaseRuleFactory<BigDecimal>
org.apache.commons.math3.analysis.integration.gauss.LegendreHighPrecisionRuleFactory
Factory that creates Gauss-type quadrature rule using Legendre polynomials.
In this implementation, the lower and upper bounds of the natural interval
of integration are -1 and 1, respectively.
The Legendre polynomials are evaluated using the recurrence relation
presented in
Abramowitz and Stegun, 1964.
- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final MathContext
Settings for enhanced precision computations.private final BigDecimal
The number-1
.private final BigDecimal
The number0.5
.private final BigDecimal
The number2
. -
Constructor Summary
ConstructorsConstructorDescriptionDefault precision isDECIMAL128
.LegendreHighPrecisionRuleFactory
(MathContext mContext) -
Method Summary
Modifier and TypeMethodDescriptionprotected Pair
<BigDecimal[], BigDecimal[]> computeRule
(int numberOfPoints) Computes the rule for the given order.Methods inherited from class org.apache.commons.math3.analysis.integration.gauss.BaseRuleFactory
addRule, getRule, getRuleInternal
-
Field Details
-
mContext
Settings for enhanced precision computations. -
two
The number2
. -
minusOne
The number-1
. -
oneHalf
The number0.5
.
-
-
Constructor Details
-
LegendreHighPrecisionRuleFactory
public LegendreHighPrecisionRuleFactory()Default precision isDECIMAL128
. -
LegendreHighPrecisionRuleFactory
- Parameters:
mContext
- Precision setting for computing the quadrature rules.
-
-
Method Details
-
computeRule
protected Pair<BigDecimal[],BigDecimal[]> computeRule(int numberOfPoints) throws DimensionMismatchException Computes the rule for the given order.- Specified by:
computeRule
in classBaseRuleFactory<BigDecimal>
- Parameters:
numberOfPoints
- Order of the rule to be computed.- Returns:
- the computed rule.
- Throws:
DimensionMismatchException
- if the elements of the pair do not have the same length.
-