## org.apache.commons.math3.analysis.integration.gauss
Class LegendreHighPrecisionRuleFactory

    java.lang.Object
      org.apache.commons.math3.analysis.integration.gauss.BaseRuleFactory<java.math.BigDecimal>
          org.apache.commons.math3.analysis.integration.gauss.LegendreHighPrecisionRuleFactory

    public class LegendreHighPrecisionRuleFactory

extends BaseRuleFactory<java.math.BigDecimal>

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 .

Since:
  3.1
Version:
  $Id: LegendreHighPrecisionRuleFactory.java 1374187 2012-08-17 09:50:54Z erans $

Field Summary
`private java.math.MathContext` `mContext` Settings for enhanced precision computations.
`private java.math.BigDecimal` `minusOne` The number `-1`.
`private java.math.BigDecimal` `oneHalf` The number `0.5`.
`private java.math.BigDecimal` `two` The number `2`.

Constructor Summary
`LegendreHighPrecisionRuleFactory()` Default precision is `DECIMAL128`.
`LegendreHighPrecisionRuleFactory(java.math.MathContext mContext)`

Method Summary
`protected Pair<java.math.BigDecimal[],java.math.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`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### mContext

    private final java.math.MathContext mContext

  Settings for enhanced precision computations.

### two

    private final java.math.BigDecimal two

  The number `2`.

### minusOne

    private final java.math.BigDecimal minusOne

  The number `-1`.

### oneHalf

    private final java.math.BigDecimal oneHalf

  The number `0.5`.

Constructor Detail

### LegendreHighPrecisionRuleFactory

    public LegendreHighPrecisionRuleFactory()

  Default precision is `DECIMAL128`.

### LegendreHighPrecisionRuleFactory

    public LegendreHighPrecisionRuleFactory(java.math.MathContext mContext)

Parameters:
  `mContext` - Precision setting for computing the quadrature rules.

Method Detail

### computeRule

    protected Pair<java.math.BigDecimal[],java.math.BigDecimal[]> computeRule(int numberOfPoints)

  Computes the rule for the given order.

  Specified by:
    `computeRule` in class `BaseRuleFactory<java.math.BigDecimal>`
  Parameters:
    `numberOfPoints` - Order of the rule to be computed.
  Returns:
    the computed rule.
  Throws:
    `NotStrictlyPositiveException` - if `numberOfPoints < 1`.

Copyright (c) 2003-2013 Apache Software Foundation