de.torstennahm.integrate.quadratureformula
Class DeltaGenerator

java.lang.Object
  extended by de.torstennahm.integrate.quadratureformula.AbstractCachedGenerator
      extended by de.torstennahm.integrate.quadratureformula.DeltaGenerator
All Implemented Interfaces:
Generator

public class DeltaGenerator
extends AbstractCachedGenerator

This generator takes an underlying quadrature formula generator, producing a corresponding generator for delta integration. Let wrapped be the underlying generator. Then, for or a given level l, this.getByLevel(l) will return a quadrature formula representing the difference between wrapped.getByLevel(l) minus wrapped.getByLevel(l-1). In the special case of l equals 0, wrapped.getByLevel(0) is returned.

The DeltaWrapper generator supports only the getByLevel method, as the getByNodes method does not make sense for delta integration.

According to general Generator contract, this class is thread-safe.

Author:
Torsten Nahm

Field Summary
 
Fields inherited from class de.torstennahm.integrate.quadratureformula.AbstractCachedGenerator
levelCache, weightsCache
 
Constructor Summary
DeltaGenerator(Generator generator)
          Creates the DeltaGenerator.
 
Method Summary
 QuadratureFormula generateByLevel(int level)
          Returns the quadrature formula representing the difference between quadrature formula produced by the underlying generator for the specified level and the specified level minus 1.
 QuadratureFormula generateByNodes(int nodesRequested)
          This method is not supported, as delta integration only makes sense between successive levels of quadrature formulas.
 int maxLevel()
          Returns the maximum argument supported by getByLevel.
 int maxNodes()
          This method is not supported, as delta integration only makes sense between successive levels of quadrature formulas.
 java.lang.String toString()
           
 
Methods inherited from class de.torstennahm.integrate.quadratureformula.AbstractCachedGenerator
getByLevel, getByNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeltaGenerator

public DeltaGenerator(Generator generator)
Creates the DeltaGenerator.

Parameters:
generator - generator for which the delta quadrature formula are to be calculated
Method Detail

maxLevel

public int maxLevel()
Description copied from interface: Generator
Returns the maximum argument supported by getByLevel.

Returns:
maximum level, or -1 for no maximum

generateByNodes

public QuadratureFormula generateByNodes(int nodesRequested)
This method is not supported, as delta integration only makes sense between successive levels of quadrature formulas.

Specified by:
generateByNodes in class AbstractCachedGenerator
Throws:
java.lang.UnsupportedOperationException

maxNodes

public int maxNodes()
This method is not supported, as delta integration only makes sense between successive levels of quadrature formulas.

Returns:
maximum number of nodes, or -1 for no maximum
Throws:
java.lang.UnsupportedOperationException

generateByLevel

public QuadratureFormula generateByLevel(int level)
Returns the quadrature formula representing the difference between quadrature formula produced by the underlying generator for the specified level and the specified level minus 1. If level is 0, the unmodified weights for level 0 are returned.

Specified by:
generateByLevel in class AbstractCachedGenerator
Returns:
delta quadrature formula for the specified level

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object