Class LegendreRule
- java.lang.Object
-
- dev.nm.analysis.integration.univariate.riemann.gaussian.rule.LegendreRule
-
- All Implemented Interfaces:
GaussianQuadratureRule
public class LegendreRule extends Object implements GaussianQuadratureRule
- See Also:
- Wikipedia: Legendre polynomials
-
-
Constructor Summary
Constructors Constructor Description LegendreRule(int n)
Create a Legendre rule of the given order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getCoefficients()
Get the coefficients \(c_i\) associated with each evaluation point \(x_i\).double[]
getEvaluationPoints()
Get the evaluation points for the quadrature rule (\(x_i\)).double
getWeighting(double x)
Get the weighting \(w(x_i)\) associated with a point \(x_i\).boolean
supportsInterval(double a, double b)
Return whether the given interval (a,b) is supported by this rule.
-
-
-
Method Detail
-
getEvaluationPoints
public double[] getEvaluationPoints()
Description copied from interface:GaussianQuadratureRule
Get the evaluation points for the quadrature rule (\(x_i\)).- Specified by:
getEvaluationPoints
in interfaceGaussianQuadratureRule
- Returns:
- the evaluation points
-
getCoefficients
public double[] getCoefficients()
Description copied from interface:GaussianQuadratureRule
Get the coefficients \(c_i\) associated with each evaluation point \(x_i\).- Specified by:
getCoefficients
in interfaceGaussianQuadratureRule
- Returns:
- the coefficients of the evaluation points
-
getWeighting
public double getWeighting(double x)
Description copied from interface:GaussianQuadratureRule
Get the weighting \(w(x_i)\) associated with a point \(x_i\).- Specified by:
getWeighting
in interfaceGaussianQuadratureRule
- Parameters:
x
- the evaluation point- Returns:
- the weighting of the given evaluation point \(w(x)\)
-
supportsInterval
public boolean supportsInterval(double a, double b)
Description copied from interface:GaussianQuadratureRule
Return whether the given interval (a,b) is supported by this rule.- Specified by:
supportsInterval
in interfaceGaussianQuadratureRule
- Parameters:
a
- the start point of the intervalb
- the end point of the interval- Returns:
true
if the interval is supported
-
-