T
- Type of the number used to represent the points and weights of
the quadrature rules.public abstract class FieldAbstractRuleFactory<T extends CalculusFieldElement<T>> extends Object implements FieldRuleFactory<T>
computeRule
method.Constructor and Description |
---|
FieldAbstractRuleFactory(Field<T> field)
Simple constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract Pair<T[],T[]> |
computeRule(int numberOfPoints)
Computes the rule for the given order.
|
protected void |
enforceSymmetry(T[] roots)
Enforce symmetry of roots.
|
protected T[] |
findRoots(int n,
CalculusFieldUnivariateFunction<T> ratioEvaluator)
Computes roots of the associated orthogonal polynomials.
|
Field<T> |
getField()
Get the field to which rule coefficients belong.
|
Pair<T[],T[]> |
getRule(int numberOfPoints)
Gets a copy of the quadrature rule with the given number of integration
points.
|
public Field<T> getField()
public Pair<T[],T[]> getRule(int numberOfPoints) throws MathIllegalArgumentException
getRule
in interface FieldRuleFactory<T extends CalculusFieldElement<T>>
numberOfPoints
- Number of integration points.MathIllegalArgumentException
- if numberOfPoints < 1
.protected abstract Pair<T[],T[]> 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 T[] findRoots(int n, CalculusFieldUnivariateFunction<T> 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(T[] roots)
roots
- roots to process in placeCopyright © 2016-2021 CS GROUP. All rights reserved.