de.torstennahm.integrate.sparse.evaluateindex
Class DeltaWeightEvaluator

java.lang.Object
  extended by de.torstennahm.integrate.sparse.evaluateindex.DeltaWeightEvaluator
All Implemented Interfaces:
Evaluator

public class DeltaWeightEvaluator
extends java.lang.Object
implements Evaluator

Performs index evaluation using delta quadrature formulas generated from a quadrature formula generator. The delta quadrature formulas are generated based on the given generator, and integration is performed with the tensor product of the delta quadrature formulas. This class is thread-safe.

Author:
Torsten Nahm

Constructor Summary
DeltaWeightEvaluator(de.torstennahm.math.Function function, Generator generator)
          Constructs the evaluator.
 
Method Summary
 boolean canEvaluate(Index index)
          Returns whether the index evaluator can evaluate the given index.
 double deltaEvaluate(Index index)
          Evaluates the integration function for the given integration index.
 int dimension()
          Returns the dimension with which this index evaluator works.
 int pointsForIndex(Index index)
          Returns the number of points the function needs to be evaluated at for this index.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DeltaWeightEvaluator

public DeltaWeightEvaluator(de.torstennahm.math.Function function,
                            Generator generator)
Constructs the evaluator.

Parameters:
function - function to be integrated
generator - quadrature formula generator
Method Detail

dimension

public int dimension()
Description copied from interface: Evaluator
Returns the dimension with which this index evaluator works. The value 0 means the dimension is indeterminate.

Specified by:
dimension in interface Evaluator
Returns:
dimension for the index evaluator

deltaEvaluate

public double deltaEvaluate(Index index)
                     throws IntegrationFailedException
Description copied from interface: Evaluator
Evaluates the integration function for the given integration index.

Specified by:
deltaEvaluate in interface Evaluator
Parameters:
index - integration index
Returns:
index contribution
Throws:
IntegrationFailedException - if an integration error occurs

canEvaluate

public boolean canEvaluate(Index index)
Description copied from interface: Evaluator
Returns whether the index evaluator can evaluate the given index. For example, if an underlying quadrature formula generator does not support the required number of nodes, evaluation of the index is not possible. Calling evaluateIndex on an index for which this method returns false will produce an IntegrationFailedException. This method returns false exactly if neededEvaluations returns 0.

Specified by:
canEvaluate in interface Evaluator
Parameters:
index - index
Returns:
true if the index can be evaluated

pointsForIndex

public int pointsForIndex(Index index)
Description copied from interface: Evaluator
Returns the number of points the function needs to be evaluated at for this index.

Specified by:
pointsForIndex in interface Evaluator
Parameters:
index - integration index
Returns:
number of function calls; 0 is returned if the evaluation of this index is not possible

toString

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