public abstract class AbstractRuleFactory extends Object implements RuleFactory
computeRule
method.Constructor and Description |
---|
AbstractRuleFactory() |
Modifier and Type | Method and Description |
---|---|
protected abstract Pair<double[],double[]> |
computeRule(int numberOfPoints)
Computes the rule for the given order.
|
protected void |
enforceSymmetry(double[] roots)
Enforce symmetry of roots.
|
protected double[] |
findRoots(int n,
UnivariateFunction ratioEvaluator)
Computes roots of the associated orthogonal polynomials.
|
Pair<double[],double[]> |
getRule(int numberOfPoints)
Gets a copy of the quadrature rule with the given number of integration
points.
|
public Pair<double[],double[]> getRule(int numberOfPoints) throws MathIllegalArgumentException
getRule
in interface RuleFactory
numberOfPoints
- Number of integration points.MathIllegalArgumentException
- if numberOfPoints < 1
.protected abstract Pair<double[],double[]> computeRule(int numberOfPoints) throws MathIllegalArgumentException
numberOfPoints
- Order of the rule to be computed.MathIllegalArgumentException
- if the elements of the pair do not
have the same length.protected double[] findRoots(int n, UnivariateFunction ratioEvaluator)
The roots are found using the Aberth method. The guess points for initializing search for degree n are fixed for degrees 1 and 2 and are selected from n-1 roots of rule n-1 (the two extreme roots are used, plus the n-1 intermediate points between all roots).
n
- number of roots to search forratioEvaluator
- function evaluating the ratio Pₙ(x)/Pₙ'(x)protected void enforceSymmetry(double[] roots)
roots
- roots to process in placeCopyright © 2016-2022 CS GROUP. All rights reserved.