|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.torstennahm.integrate.Integrator<Evaluator> de.torstennahm.integrate.sparse.WeightedIntegrator
public class WeightedIntegrator
Adaptive sparse grid integrator that uses a weighted balance of
index contributions and work in expanding the index set.
With the default constructor, the integrator uses a pure greedy approache:
It will always add that value to the index set whose calculated contribution is the largest,
regardless of the work involved. However, it is possible to balance
this against the work involved, by supplying a weight w factor
in the constructor. In this case, w balances the calculated contribution
against the amount of work involved with the following formula:
priority = max((1-w)*relContribution,w*(1/relWork)),
where relContribution is the quotient of the calculated contribution
for the index and the (current estimate of the) integral value,
and relWork is the quotient between the number of function calls required
for evaluating the index and those for the zero index.
The default is the same as setting w to 0 in the above formula. If on the other hand w is 1, the controller will default to non-adaptive simplicial sparse grid integration, as relWork increases monotonically with the length of the index.
Note that although the valid indices whose contributions have been calculated are not formally part of the index set, their contributions still are used for the integral value, as this can only improve accuracy.
This class implements the original algorithm for sparse grid integration published in: T. Gerstner and M. Griebel. Dimension-Adaptive Tensor-Product Quadrature. Computing, 71(1):65-87, 2003
This class is thread-safe.
Integrator
,
IntegrationResult
,
Evaluator
,
Visualizer
Field Summary | |
---|---|
protected double |
workWeight
Factor for balance between greedy and work |
Constructor Summary | |
---|---|
WeightedIntegrator()
Constructs the weighted sparse integrator with the default settings. |
|
WeightedIntegrator(double workWeight)
Construct the weighted sparse integrator with the specified work weight factor. |
Method Summary | |
---|---|
IntegrationResult |
integrate(Evaluator evaluator,
StopCondition condition,
java.util.List<Visualizer> visualizers)
Performs numerical integration of the integrand until the given condition is fulfilled. |
java.lang.String |
toString()
|
Methods inherited from class de.torstennahm.integrate.Integrator |
---|
integrate, integrateAbsTol, integrateAbsTol, integrateByPoints, integrateByPoints, integrateRelTol, integrateRelTol |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final double workWeight
Constructor Detail |
---|
public WeightedIntegrator()
WeightedIntegrator(0)
.
WeightedIntegrator(double)
public WeightedIntegrator(double workWeight)
workWeight
- factor for balancing contribution against work; must be between 0 and 1
java.lang.IllegalArgumentException
- if the work weight is out of rangeMethod Detail |
---|
public IntegrationResult integrate(Evaluator evaluator, StopCondition condition, java.util.List<Visualizer> visualizers) throws IntegrationFailedException
Integrator
integrate
in class Integrator<Evaluator>
evaluator
- object to be integratedcondition
- stop conditionvisualizers
- list of visualizers or null
for no visualization
IntegrationFailedException
- if an integration error occurspublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |