de.torstennahm.integrate.quadratureformula
Interface Generator

All Known Implementing Classes:
AbstractCachedGenerator, ClenshawCurtis, DeltaGenerator, GaussHermite, GaussianWrapper, GaussLegendre, OpenTrapezoidal, Patterson, Trapezoidal

public interface Generator

This class generates quadrature formulas for given levels of integration. Subclasses each implement specific rules, such as the trapezoidal rule or the Clenshaw-Curtis rule.

Implementor's note: The generation of the quadrature formulas should be quick. It is therefore recommended to use a cache for the quadrature formulas, so they can be returned immediately. This may be done by subclassing AbstractGeneratorCache, which provides a framework for caching.

All subclasses are required to be thread-safe.

Author:
Torsten Nahm

Method Summary
 QuadratureFormula getByLevel(int level)
          This routine is similar to getByLevel, but here the argument is only an abstract measure of the number of node-and-weight-pairs returned.
 QuadratureFormula getByNodes(int nodesRequested)
          Returns a set of node-and-weight pairs in an QuadratureFormula object.
 int maxLevel()
          Returns the maximum argument supported by getByLevel.
 int maxNodes()
          Returns the maximum argument supported by getByNodes.
 

Method Detail

getByNodes

QuadratureFormula getByNodes(int nodesRequested)
Returns a set of node-and-weight pairs in an QuadratureFormula object. The number of nodes returned should be the same as those requested. If this is not possible due to the special structure of the generator, the number of nodes returned must be larger than that requested. However, when 1 node is requested exactly 1 pair must be returned.

The number of nodes requested must be between 1 and getMaxNodes().

Parameters:
nodesRequested - number of nodes for the quadrature formula
Returns:
quadrature formula
Throws:
java.lang.IllegalArgumentException - if the number of nodes requested is not in the valid range

getByLevel

QuadratureFormula getByLevel(int level)
This routine is similar to getByLevel, but here the argument is only an abstract measure of the number of node-and-weight-pairs returned. In general, the number of weights should rise exponentially with the level. However, the only conditions imposed it that the number of pairs should rise strictly monotonously with the level. level must be between 0 and getMaxLevel().

In the special case where level is requested as 0, a quadrature formula with exactly 1 pair must be returned.

Parameters:
level - level of the quadrature formula
Returns:
quadrature formula
Throws:
java.lang.IllegalArgumentException - if the level is not in the valid range

maxNodes

int maxNodes()
Returns the maximum argument supported by getByNodes.

Returns:
maximum number of nodes, or -1 for no maximum

maxLevel

int maxLevel()
Returns the maximum argument supported by getByLevel.

Returns:
maximum level, or -1 for no maximum