de.torstennahm.integrate.sparse.evaluateindex
Interface Evaluator

All Known Implementing Classes:
DeltaWeightEvaluator

public interface Evaluator

Calculates the integral contribution of a function for a multi-index. The index evaluator also keeps track of how often the integrand function has been called as a result of index evaluation.

Author:
Torsten Nahm

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.
 

Method Detail

dimension

int dimension()
Returns the dimension with which this index evaluator works. The value 0 means the dimension is indeterminate.

Returns:
dimension for the index evaluator

deltaEvaluate

double deltaEvaluate(Index index)
                     throws IntegrationFailedException
Evaluates the integration function for the given integration index.

Parameters:
index - integration index
Returns:
index contribution
Throws:
IntegrationFailedException - if an integration error occurs

canEvaluate

boolean canEvaluate(Index index)
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.

Parameters:
index - index
Returns:
true if the index can be evaluated

pointsForIndex

int pointsForIndex(Index index)
Returns the number of points the function needs to be evaluated at for this index.

Parameters:
index - integration index
Returns:
number of function calls; 0 is returned if the evaluation of this index is not possible